Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The state of fired trigger is always executing and not removed from fired trigger collection #3

Open
PNTrong opened this issue Dec 19, 2019 · 0 comments

Comments

@PNTrong
Copy link

PNTrong commented Dec 19, 2019

Hi Chris and Frantisek,

My server is running on multiple instances so I enabled clustering.
My job is running every minute. It's almost working well when I deploy the server. But sometimes the trigger state of the job is blocked because the state of fired trigger is "executing" in the database and it is not removed after the trigger is fired.
Could you please help me to list some reasons for this issue?

This is my code, I program multi-threads so I'm not sure that the issue is from it.

public async Task Execute(IJobExecutionContext context)
		{
			var stopwatch = new Stopwatch();
			stopwatch.Start();

			_logger.Info($"Automation Job is run at {DateTime.UtcNow}");

			// Run automation event
			var automationEventThread = RunCampaignAutomationEvent();

			// Run reminder service
			var reminderNotificationThread = _reminderService.RunReminderNotification();

			// Push notification for mobile based on Start Time and Reminder Before value.
			var reminderPushNotificationThread = _reminderService.PushNotificationToAssignee();

			await Task.WhenAll(automationEventThread, reminderNotificationThread, reminderPushNotificationThread);

			stopwatch.Stop();

			_logger.Info("Time elapsed: {0}", stopwatch.Elapsed);
		}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant