summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/backup_job.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/backup_job.rb b/app/models/backup_job.rb
index a04f6c0..48dd27e 100644
--- a/app/models/backup_job.rb
+++ b/app/models/backup_job.rb
@@ -12,12 +12,17 @@ class BackupJob < ActiveRecord::Base
private
def set_state_to_queued
- self.state = 'queued'
+ self.state ||= 'queued'
self.started_at = Time.now
end
def initiate_backup
- self.delay.make_a_backup
+ if self.state == 'force now'
+ self.state = 'queued'
+ self.make_a_backup
+ else
+ self.delay.make_a_backup
+ end
end
def make_a_backup