Optimise write lock parameters

This commit is contained in:
Kamil Trzciński 2018-05-07 10:34:47 +02:00
parent 819fccd6c7
commit 2a03142c94
1 changed files with 5 additions and 5 deletions

View File

@ -12,9 +12,9 @@ module Ci
CHUNK_SIZE = 128.kilobytes
CHUNK_REDIS_TTL = 1.week
WRITE_LOCK_RETRY = 100
WRITE_LOCK_SLEEP = 1
WRITE_LOCK_TTL = 5.minutes
WRITE_LOCK_RETRY = 10
WRITE_LOCK_SLEEP = 5.milisecond
WRITE_LOCK_TTL = 1.minute
enum data_store: {
redis: 1,
@ -96,7 +96,7 @@ module Ci
save! if changed?
end
schedule_to_db if fullfilled?
schedule_to_db if full?
end
def schedule_to_db
@ -105,7 +105,7 @@ module Ci
Ci::BuildTraceChunkFlushWorker.perform_async(id)
end
def fullfilled?
def full?
size == CHUNK_SIZE
end