mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 15:21:03 +00:00
fixed a problem in bioOlderJobType() when there are no jobs of the specified type. Now the function returns 0 when this happens.
This commit is contained in:
parent
fbb23ce496
commit
b39a4d0b39
@ -188,6 +188,10 @@ time_t bioOlderJobOfType(int type) {
|
|||||||
|
|
||||||
pthread_mutex_lock(&bio_mutex[type]);
|
pthread_mutex_lock(&bio_mutex[type]);
|
||||||
ln = listFirst(bio_jobs[type]);
|
ln = listFirst(bio_jobs[type]);
|
||||||
|
if (ln == NULL) {
|
||||||
|
pthread_mutex_unlock(&bio_mutex[type]);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
job = ln->value;
|
job = ln->value;
|
||||||
time = job->time;
|
time = job->time;
|
||||||
pthread_mutex_unlock(&bio_mutex[type]);
|
pthread_mutex_unlock(&bio_mutex[type]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user