2024-05-03 03:04:43 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
namespace :e621 do
|
|
|
|
desc "Tasks related to e621"
|
|
|
|
task status_update: :environment do
|
2024-08-06 11:21:24 +00:00
|
|
|
E621StatusUpdateJob.perform_now
|
2024-05-03 03:04:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
task remove_timeouts: :environment do
|
2024-05-03 05:54:36 +00:00
|
|
|
E621Thumbnail.where(status: "timeout", created_at: ..5.minutes.ago).find_each do |entry|
|
2024-05-03 03:04:43 +00:00
|
|
|
puts "Removing timed out generation for post #{entry.post_id} (#{entry.stripped_md5}"
|
|
|
|
entry.destroy
|
|
|
|
end
|
|
|
|
end
|
2024-06-04 19:48:30 +00:00
|
|
|
|
|
|
|
task exports: :environment do
|
|
|
|
E621.constants.map { |c| E621.const_get(c) }.filter { |c| c < ApplicationRecord }.each do |type|
|
|
|
|
puts "Updating #{type}"
|
|
|
|
type.sync!
|
|
|
|
end
|
|
|
|
E621::Pool.sync_tags!
|
|
|
|
E621PoolImportJob.perform_now
|
|
|
|
end
|
2024-05-03 03:04:43 +00:00
|
|
|
end
|