c9396f31c6
This prevents a MITM attack where attacker could still access Git repository if any jobs were running long enough.
13 lines
375 B
Ruby
13 lines
375 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Ci
|
|
class CancelUserPipelinesService
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
# This is a bug with CodeReuse/ActiveRecord cop
|
|
# https://gitlab.com/gitlab-org/gitlab/issues/32332
|
|
def execute(user)
|
|
user.pipelines.cancelable.find_each(&:cancel_running)
|
|
end
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
end
|
|
end
|