mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Backup didn't work anymore after a running backup was canceled
This commit is contained in:
committed by
Gerhard Schlager
parent
8c77b84aac
commit
1febf11362
@@ -96,6 +96,8 @@ module BackupRestore
|
|||||||
end
|
end
|
||||||
|
|
||||||
def listen_for_shutdown_signal
|
def listen_for_shutdown_signal
|
||||||
|
BackupRestore.clear_shutdown_signal!
|
||||||
|
|
||||||
Thread.new do
|
Thread.new do
|
||||||
while BackupRestore.is_operation_running?
|
while BackupRestore.is_operation_running?
|
||||||
exit if BackupRestore.should_shutdown?
|
exit if BackupRestore.should_shutdown?
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ module BackupRestore
|
|||||||
end
|
end
|
||||||
|
|
||||||
def listen_for_shutdown_signal
|
def listen_for_shutdown_signal
|
||||||
|
BackupRestore.clear_shutdown_signal!
|
||||||
|
|
||||||
Thread.new do
|
Thread.new do
|
||||||
while BackupRestore.is_operation_running?
|
while BackupRestore.is_operation_running?
|
||||||
exit if BackupRestore.should_shutdown?
|
exit if BackupRestore.should_shutdown?
|
||||||
|
|||||||
@@ -69,6 +69,15 @@ describe BackupRestore::SystemInterface do
|
|||||||
thread.join
|
thread.join
|
||||||
end.to raise_error(SystemExit)
|
end.to raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "clears an existing shutdown signal before it starts to listen" do
|
||||||
|
BackupRestore.set_shutdown_signal!
|
||||||
|
expect(BackupRestore.should_shutdown?).to eq(true)
|
||||||
|
|
||||||
|
thread = subject.listen_for_shutdown_signal
|
||||||
|
expect(BackupRestore.should_shutdown?).to eq(false)
|
||||||
|
Thread.kill(thread)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#pause_sidekiq" do
|
describe "#pause_sidekiq" do
|
||||||
|
|||||||
Reference in New Issue
Block a user