Skip to content

Commit e8113a4

Browse files
committed
Rename telegram_post_worker_job to telegram_background_worker_job
1 parent 6f1148e commit e8113a4

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

app/jobs/telegram_post_worker_job.rb renamed to app/jobs/telegram_background_worker_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module PostAction
44
DELETE_ALERT_MESSAGE = "delete_alert_msg"
55
end
66

7-
class TelegramPostWorkerJob < ApplicationJob
7+
class TelegramBackgroundWorkerJob < ApplicationJob
88
"background worker to execute job after specific event"
99
queue_as :low_priority
1010

app/models/trained_message.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def should_ban_user
3939
spam_count = TrainedMessage.where(group_id: self.group_id, sender_chat_id: self.sender_chat_id, message_type: :spam).count
4040
if spam_count >= spam_ban_threshold
4141
Rails.logger.info "user: #{self.sender_user_name} sent more than 3 spam messages in group: #{self.group_id}, ban this user from group"
42-
TelegramPostWorkerJob.perform_later(
42+
TelegramBackgroundWorkerJob.perform_later(
4343
action: PostAction::BAN_USER,
4444
trained_message: self
4545
)

app/services/telegram_botter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def handle_regular_message(bot, message)
306306

307307
# 3. Schedule a background job to delete the warning message
308308
# to avoid polluting the group chat
309-
TelegramPostWorkerJob.set(wait: delete_message_delay.minutes).perform_later(
309+
TelegramBackgroundWorkerJob.set(wait: delete_message_delay.minutes).perform_later(
310310
action: PostAction::DELETE_ALERT_MESSAGE,
311311
chat_id: sent_warning_message.chat.id,
312312
message_id: sent_warning_message.message_id)

test/jobs/telegram_post_worker_job_test.rb renamed to test/jobs/telegram_background_worker_job_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "test_helper"
22

3-
class TelegramPostWorkerJobTest < ActiveJob::TestCase
3+
class TelegramBackgroundWorkerJobTest < ActiveJob::TestCase
44
# test "the truth" do
55
# assert true
66
# end

0 commit comments

Comments
 (0)