2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-08-03 07:53:48 +08:00
|
|
|
module Jobs
|
2019-10-02 12:01:53 +08:00
|
|
|
class CheckOutOfDateThemes < ::Jobs::Scheduled
|
2018-08-03 07:53:48 +08:00
|
|
|
every 1.day
|
|
|
|
|
|
|
|
def execute(args)
|
|
|
|
target_themes =
|
|
|
|
RemoteTheme
|
|
|
|
.joins("JOIN themes ON themes.remote_theme_id = remote_themes.id")
|
|
|
|
.where.not(remote_url: "")
|
|
|
|
|
|
|
|
target_themes.each do |remote|
|
2023-01-10 01:56:43 +08:00
|
|
|
Discourse.capture_exceptions(message: "Error updating theme #{remote.id}") do
|
|
|
|
remote.update_remote_version
|
|
|
|
remote.save!
|
|
|
|
end
|
2018-08-03 07:53:48 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|