2013-02-19 15:16:50 -05:00
|
|
|
require_dependency 'discourse_hub'
|
|
|
|
require_dependency 'discourse_updates'
|
|
|
|
|
|
|
|
module Jobs
|
|
|
|
class VersionCheck < Jobs::Base
|
|
|
|
|
|
|
|
def execute(args)
|
2013-02-21 10:19:02 -05:00
|
|
|
if SiteSetting.version_checks
|
|
|
|
json = DiscourseHub.discourse_version_check
|
|
|
|
DiscourseUpdates.latest_version = json['latestVersion']
|
2013-03-06 10:34:15 -05:00
|
|
|
DiscourseUpdates.critical_updates_available = json['criticalUpdates']
|
2013-03-05 18:14:51 -05:00
|
|
|
DiscourseUpdates.missing_versions_count = json['missingVersionsCount']
|
2013-02-21 10:19:02 -05:00
|
|
|
end
|
2013-02-19 15:16:50 -05:00
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|