parent
41ba9ee146
commit
dddf9291f9
@ -0,0 +1,11 @@
|
||||
class DeleteUnpublishVideoJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(*args)
|
||||
# "清理过时视频,一周之前用户还未确定上传的视频"
|
||||
videos = Video.where(transcoded: false, delete_state: nil, status: 'pending').where("updated_at < '#{Time.now.days_ago(7)}'")
|
||||
videos.find_each do |d|
|
||||
d.destroy
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,3 @@
|
||||
delete_unpublish_video_job:
|
||||
cron: "0 24 * * *"
|
||||
class: "DeleteUnpublishVideoJob"
|
Loading…
Reference in new issue