Skip to content

Commit 689ea15

Browse files
committed
Update Status
Removing unless code Signed-off-by: Rodrigo Nardi <rnardi@netdef.org>
1 parent 7e676d9 commit 689ea15

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

.simplecov

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SimpleCov.start do
1313
primary_coverage :branch
1414
add_filter %r{^/(spec|config)/}
1515
add_filter 'database_loader.rb'
16+
add_filter 'workers/slack_username2_id.rb'
1617
add_group 'Models', 'lib/models'
1718
add_group 'GitHub Functions', 'lib/github'
1819
add_group 'Bamboo CI Functions', 'lib/bamboo_ci'

lib/github/update_status.rb

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def update_status
8181
end
8282

8383
def create_timeout_worker
84-
Delayed::Job.where('handler LIKE ?', "%TimeoutExecution%args%-%#{@check_suite.id}%")&.delete_all
84+
Delayed::Job.where('handler LIKE ?', "%TimeoutExecution%args%-%#{@check_suite.id}%").delete_all
8585

8686
logger(Logger::INFO, "CiJobStatus::Update: TimeoutExecution for '#{@check_suite.id}'")
8787

@@ -97,7 +97,7 @@ def insert_new_delayed_job
9797
end
9898

9999
def delete_and_create_delayed_job(queue)
100-
fetch_delayed_job&.destroy_all
100+
fetch_delayed_job.destroy_all
101101

102102
CiJobStatus
103103
.delay(run_at: DELAYED_JOB_TIMER.seconds.from_now.utc, queue: queue)
@@ -130,18 +130,6 @@ def failure
130130
.update(@job.id, 1)
131131
end
132132

133-
def slack_notify_success
134-
return unless current_execution?
135-
136-
SlackBot.instance.notify_success(@job)
137-
end
138-
139-
def slack_notify_failure
140-
return unless current_execution?
141-
142-
SlackBot.instance.notify_errors(@job)
143-
end
144-
145133
def logger(severity, message)
146134
@loggers.each do |logger_object|
147135
logger_object.add(severity, message)

0 commit comments

Comments
 (0)