FIX: compare UTC dates to schedule backups

This commit is contained in:
Régis Hanol 2015-11-12 18:35:03 +01:00
parent ea29e1c693
commit 3c2486e2ba
1 changed files with 2 additions and 2 deletions

View File

@ -8,8 +8,8 @@ module Jobs
return unless SiteSetting.automatic_backups_enabled? return unless SiteSetting.automatic_backups_enabled?
if latest_backup = Backup.all[0] if latest_backup = Backup.all[0]
date = File.ctime(latest_backup.path).to_date date = File.ctime(latest_backup.path).getutc.to_date
return if (date + SiteSetting.backup_frequency.days) > Time.now.to_date return if (date + SiteSetting.backup_frequency.days) > Time.now.utc.to_date
end end
Jobs.cancel_scheduled_job(:create_backup) Jobs.cancel_scheduled_job(:create_backup)