Skip to content

Instantly share code, notes, and snippets.

@jlsherrill
Last active February 28, 2019 15:24
Show Gist options
  • Save jlsherrill/78884fb933e06e26b8e6 to your computer and use it in GitHub Desktop.
Save jlsherrill/78884fb933e06e26b8e6 to your computer and use it in GitHub Desktop.
clearing ListenOnCandlepin Events

Shut down foreman-tasks:

  service foreman-tasks stop

Open the rails console:

foreman-rake console

and run:

ForemanTasks::Task.where(:label => 'Actions::Candlepin::ListenOnCandlepinEvents').destroy_all
exit

start foreman-tasks:

service foreman-tasks start
@jgkootstra
Copy link

jgkootstra commented Feb 28, 2019

For those of us that like a batch mode approach

combining my and @sneckfilter's contribution and some other input

RHEL7/CentOS7

stop foreman tasks:
systemctl stop foreman-tasks

destroy paused tasks:

foreman-rake console <<< 'ForemanTasks::Task.where(:state => :paused).where(:label => 'Actions::Candlepin::ListenOnCandlepinEvents').destroy_all' 

start foreman tasks:
systemctl start foreman-tasks

RHEL6/CentOS6

stop foreman tasks:
service foreman-tasks stop

destroy paused tasks:

foreman-rake console <<< 'ForemanTasks::Task.where(:state => :paused).where(:label => 'Actions::Candlepin::ListenOnCandlepinEvents').destroy_all'

start foreman tasks:
service foreman-tasks stop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment