Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@johnpmitsch

This comment has been minimized.

Copy link

johnpmitsch commented Jul 13, 2015

I have used this many times, so many thanks for posting this! 😀

@snecklifter

This comment has been minimized.

Copy link

snecklifter commented Mar 9, 2016

Hello,

Thanks for this. Can I suggest a slight modification:

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

which will prevent destruction of task history.

@MartijntenHeuvel

This comment has been minimized.

Copy link

MartijntenHeuvel commented Mar 24, 2016

Thanks for this, use it more then one would like to admit..

@jgkootstra

This comment has been minimized.

Copy link

jgkootstra commented May 5, 2018

Just a little update for RHEL 7 and CENTOS 7, this original poster has done a great job.

RHEL 6 / CENTOS 6:

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

RHEL 7 / CENTOS 7:

Shut down foreman-tasks:
systemctl stop foreman-tasks

Open the rails console:
foreman-rake console

and run:

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

start foreman-tasks:
systemctl start foreman-tasks

@jgkootstra

This comment has been minimized.

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
You can’t perform that action at this time.