Commit 2a03142c authored by Kamil Trzciński's avatar Kamil Trzciński

Optimise write lock parameters

parent 819fccd6
...@@ -12,9 +12,9 @@ module Ci ...@@ -12,9 +12,9 @@ module Ci
CHUNK_SIZE = 128.kilobytes CHUNK_SIZE = 128.kilobytes
CHUNK_REDIS_TTL = 1.week CHUNK_REDIS_TTL = 1.week
WRITE_LOCK_RETRY = 100 WRITE_LOCK_RETRY = 10
WRITE_LOCK_SLEEP = 1 WRITE_LOCK_SLEEP = 5.milisecond
WRITE_LOCK_TTL = 5.minutes WRITE_LOCK_TTL = 1.minute
enum data_store: { enum data_store: {
redis: 1, redis: 1,
...@@ -96,7 +96,7 @@ module Ci ...@@ -96,7 +96,7 @@ module Ci
save! if changed? save! if changed?
end end
schedule_to_db if fullfilled? schedule_to_db if full?
end end
def schedule_to_db def schedule_to_db
...@@ -105,7 +105,7 @@ module Ci ...@@ -105,7 +105,7 @@ module Ci
Ci::BuildTraceChunkFlushWorker.perform_async(id) Ci::BuildTraceChunkFlushWorker.perform_async(id)
end end
def fullfilled? def full?
size == CHUNK_SIZE size == CHUNK_SIZE
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment