only enqueue scan post job if new record
This commit is contained in:
@@ -156,10 +156,12 @@ class Domain::Fa::Job::FavsJob < Domain::Fa::Job::Base
|
||||
submission_parser_helper,
|
||||
first_seen_log_entry: response.log_entry,
|
||||
)
|
||||
post.enqueue_job_after_save(
|
||||
Domain::Fa::Job::ScanPostJob,
|
||||
{ post:, caused_by_entry: causing_log_entry },
|
||||
)
|
||||
if post.new_record?
|
||||
post.enqueue_job_after_save(
|
||||
Domain::Fa::Job::ScanPostJob,
|
||||
{ post:, caused_by_entry: causing_log_entry },
|
||||
)
|
||||
end
|
||||
post
|
||||
end
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ class Domain::Fa::Post < ReduxApplicationRecord
|
||||
:removed, # post has been removed
|
||||
:scan_error, # error scanning post page (see state_detail)
|
||||
:file_error, # error downloading post file (see state_detail)
|
||||
],
|
||||
default: :ok
|
||||
]
|
||||
validates_inclusion_of(:state, in: self.states.keys)
|
||||
validates_presence_of(:fa_id, :state)
|
||||
after_initialize { self.state ||= :ok }
|
||||
|
||||
belongs_to :creator,
|
||||
class_name: "::Domain::Fa::User",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
SET statement_timeout = 0;
|
||||
SET lock_timeout = 0;
|
||||
SET idle_in_transaction_session_timeout = 0;
|
||||
SET transaction_timeout = 0;
|
||||
SET client_encoding = 'UTF8';
|
||||
SET standard_conforming_strings = on;
|
||||
SELECT pg_catalog.set_config('search_path', '', false);
|
||||
|
||||
Reference in New Issue
Block a user