Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline dabelenda  
#1 Posted : Monday, December 10, 2018 9:55:42 AM(UTC)
dabelenda

Rank: Paid support

Joined: 10/18/2016(UTC)
Posts: 23

Was thanked: 3 time(s) in 3 post(s)
Hello,

I want to reset "programatically" triggers to 0, but it doesn't seam to work as expected.
Could you please direct me to the best way to reset a job trigger

I have the following code witch reset correctely in the GUI but some time doesn't seam to work correctly "behind the scene":
Quote:

...
job.ResetToWaiting();
foreach(var trigger in job.Triggers)
{
trigger.TriggerCount = 0;
server.Jobs.Triggers.Update(job, trigger);
}
job.ResetTriggerDepedency = true;
...


Can you confirm if this snippet is the correct way to do it?

Thank you

Edited by moderator Tuesday, December 11, 2018 7:08:02 PM(UTC)  | Reason: Not specified

Offline Support  
#2 Posted : Tuesday, December 11, 2018 7:07:51 PM(UTC)
Support

Rank: Official support

Joined: 2/23/2008(UTC)
Posts: 11,203

Thanks: 871 times
Was thanked: 446 time(s) in 424 post(s)
You do this;

Code:
job.ResetTriggerDepedency = true;
server.Jobs.Update(job);
Henrik
Support
http://www.visualcron.com
Please like VisualCron on facebook!
Offline dabelenda  
#3 Posted : Friday, December 14, 2018 10:35:20 AM(UTC)
dabelenda

Rank: Paid support

Joined: 10/18/2016(UTC)
Posts: 23

Was thanked: 3 time(s) in 3 post(s)
Thank you I will check that
Offline dabelenda  
#4 Posted : Monday, December 17, 2018 2:16:54 PM(UTC)
dabelenda

Rank: Paid support

Joined: 10/18/2016(UTC)
Posts: 23

Was thanked: 3 time(s) in 3 post(s)
Hello,

I still have an extraneous behaviour, when I reset the triggers and list the triggers afterwards it shows me that some trigger were triggered two times (which seems correct because it's a trigger on time and the job waits for another one) but in the GUI it shows me only 1 occurence.

Could it be an error in the GUI or do you think my show triggers could be wrong?

I simply list the trigger occurences with the trigger.TriggerCount attribute.
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top