DEV: Move jobs undear each module lib directory

This commit is contained in:
Roman Rizzi 2023-02-23 14:09:52 -03:00
parent 1afa274b99
commit ef6c785aca
No known key found for this signature in database
GPG Key ID: 64024A71CE7330D3
9 changed files with 6 additions and 7 deletions

View File

@ -5,7 +5,7 @@ module DiscourseAI
class EntryPoint
def inject_into(plugin)
require_relative "evaluation.rb"
require_relative "../../../app/jobs/regular/modules/nsfw/evaluate_content.rb"
require_relative "jobs/regular/evaluate_content.rb"
plugin.add_model_callback(Upload, :after_create) do
Jobs.enqueue(:evaluate_content, upload_id: self.id)

View File

@ -5,7 +5,7 @@ module DiscourseAI
def inject_into(plugin)
require_relative "event_handler.rb"
require_relative "post_classifier.rb"
require_relative "../../../app/jobs/regular/modules/sentiment/sentiment_classify_post.rb"
require_relative "jobs/regular/sentiment_classify_post.rb"
plugin.on(:post_created) do |post|
DiscourseAI::Sentiment::EventHandler.handle_post_async(post)

View File

@ -8,10 +8,8 @@ module DiscourseAI
require_relative "post_classifier.rb"
require_relative "chat_message_classifier.rb"
jobs_base_path = "../../../app/jobs/regular/modules/toxicity"
require_relative "#{jobs_base_path}/toxicity_classify_post.rb"
require_relative "#{jobs_base_path}/toxicity_classify_chat_message.rb"
require_relative "jobs/regular/toxicity_classify_post.rb"
require_relative "jobs/regular/toxicity_classify_chat_message.rb"
plugin.on(:post_created) do |post|
DiscourseAI::Toxicity::EventHandler.handle_post_async(post)

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
require "rails_helper"
require_relative "../../../../support/nsfw_inference_stubs"
require_relative "../../../../../support/nsfw_inference_stubs"
describe Jobs::EvaluateContent do
fab!(:image) { Fabricate(:s3_image_upload) }

View File

@ -1,4 +1,5 @@
# frozen_string_literal: true
class NSFWInferenceStubs
class << self
def endpoint