mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
add 5 second delay to queues
This commit is contained in:
parent
de9bb630d0
commit
7fe8bc5cb3
@ -20,6 +20,8 @@ CACHE_USER_EXPIRE=300
|
||||
CACHE_404_EXPIRE=604800
|
||||
CACHE_SEARCH_EXPIRE=432000
|
||||
|
||||
QUEUE_DELAY_PER_JOB=5
|
||||
|
||||
THROTTLE=false
|
||||
THROTTLE_DECAY_MINUTES=1
|
||||
THROTTLE_MAX_PER_DECAY_MINUTES=30
|
||||
|
@ -81,7 +81,12 @@ class JikanResponseHandler
|
||||
// Don't duplicate the queue for same request
|
||||
if (!app('redis')->exists($queueFingerprint)) {
|
||||
app('redis')->set($queueFingerprint, 1);
|
||||
dispatch(new UpdateCacheJob($request));
|
||||
dispatch(
|
||||
(new UpdateCacheJob($request))->delay(
|
||||
env('QUEUE_DELAY_PER_JOB', 5)
|
||||
)
|
||||
);
|
||||
|
||||
} else {
|
||||
Log::info("Duplicate ({$queueFingerprint})");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user