2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-08-02 19:53:48 -04:00
|
|
|
module Jobs
|
2019-10-02 00:01:53 -04:00
|
|
|
class CheckOutOfDateThemes < ::Jobs::Scheduled
|
2018-08-02 19:53:48 -04: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-09 12:56:43 -05:00
|
|
|
Discourse.capture_exceptions(message: "Error updating theme #{remote.id}") do
|
|
|
|
remote.update_remote_version
|
|
|
|
remote.save!
|
|
|
|
end
|
2018-08-02 19:53:48 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|