diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-05-07 11:34:47 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-05-07 11:34:47 +0300 |
commit | 2a03142c948f65311fd784d620c2d2082882bcd4 (patch) | |
tree | 0685c81615cfd22032b753bfce3488d2efb71d5b /app/models/ci/build_trace_chunk.rb | |
parent | 819fccd6c7d72fabc3bfa3807094f4c9a3226292 (diff) |
Optimise write lock parameters
Diffstat (limited to 'app/models/ci/build_trace_chunk.rb')
-rw-r--r-- | app/models/ci/build_trace_chunk.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/ci/build_trace_chunk.rb b/app/models/ci/build_trace_chunk.rb index 08a4465821c..5715477266a 100644 --- a/app/models/ci/build_trace_chunk.rb +++ b/app/models/ci/build_trace_chunk.rb @@ -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 |