Skip to content

Commit

Permalink
smax-lazy.c: Register use of monitor point until it receives backgrou…
Browse files Browse the repository at this point in the history
…nd cache update
  • Loading branch information
attipaci committed Sep 24, 2024
1 parent 07d76d5 commit 149b0d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/smax-lazy.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static LazyMonitor *GetMonitorAsync(const char *table, const char *key);
static LazyMonitor *GetSpecificMonitorAsync(const char *table, const char *key);
static void ProcessLazyUpdates(const char *pattern, const char *channel, const char *msg, long length);


/**
* Decrements the number of concurrent user calls that currently need access to the specific
* lazy monitor data. If the monitor has no users left and is not currently monitored
Expand Down Expand Up @@ -210,7 +211,10 @@ static int UpdateCachedAsync(LazyMonitor *m, boolean background) {

if(background && smaxIsPipelined()) {
status = smaxQueue(m->table, m->key, type, 1, ptr, staging->meta);
if(!status) smaxQueueCallback(ApplyUpdate, staging);
if(!status) {
m->users++;
smaxQueueCallback(ApplyUpdate, staging);
}
}
else {
status = smaxPull(m->table, m->key, type, 1, ptr, staging->meta);
Expand Down

0 comments on commit 149b0d8

Please sign in to comment.