summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-04 07:47:50 -0500
committerPeter Kozak <spag@golwen.net>2013-03-04 07:47:50 -0500
commit06ee958ddc3066cab0893bfa9174db7a76e8c250 (patch)
tree951c9211171dcc80de41b95ae68d0cc5816989b7 /app
parent14facb5c1f50ae9edd0ac842001ab8e7afa52b21 (diff)
parent6e388bedb33a07373675625a90a859bc8cf2c688 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
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