2013-02-20 04:16:50 +08:00
|
|
|
require_dependency 'discourse_hub'
|
|
|
|
require_dependency 'discourse_updates'
|
|
|
|
|
|
|
|
module Jobs
|
|
|
|
class VersionCheck < Jobs::Base
|
|
|
|
|
|
|
|
def execute(args)
|
2013-02-21 23:19:02 +08:00
|
|
|
if SiteSetting.version_checks
|
|
|
|
json = DiscourseHub.discourse_version_check
|
|
|
|
DiscourseUpdates.latest_version = json['latestVersion']
|
|
|
|
DiscourseUpdates.critical_update_available = json['criticalUpdates']
|
2013-03-06 07:14:51 +08:00
|
|
|
DiscourseUpdates.missing_versions_count = json['missingVersionsCount']
|
2013-02-21 23:19:02 +08:00
|
|
|
end
|
2013-02-20 04:16:50 +08:00
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|