mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 06:43:37 +08:00
FIX: race condition
This commit is contained in:
parent
35ea1274e2
commit
070cdbe64b
|
@ -34,7 +34,7 @@ module BackupRestore
|
||||||
|
|
||||||
def self.mark_as_running!
|
def self.mark_as_running!
|
||||||
# TODO: for extra safety, it should acquire a lock and raise an exception if already running
|
# TODO: for extra safety, it should acquire a lock and raise an exception if already running
|
||||||
$redis.set(running_key, "1")
|
$redis.setex(running_key, 60, "1")
|
||||||
save_start_logs_message_id
|
save_start_logs_message_id
|
||||||
keep_it_running
|
keep_it_running
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user