Stop multiple instance of a task

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
I have created a task that syncs orders from nopcommerce into Sage but I've found an issue with the task running multiple times.

The issue happens if i manually run the sync and the task runs on the schedule service at the same time.

Is there a way to check if the task is already running?
7 years ago
[email protected] wrote:
I have created a task that syncs orders from nopcommerce into Sage but I've found an issue with the task running multiple times.

The issue happens if i manually run the sync and the task runs on the schedule service at the same time.

Is there a way to check if the task is already running?

Not sure to be honest but the TaskManager class has a TaskThreads method and the TaskThread class has an IsRunning property so I imagine it would be possible somehow, but it would require a bit of investigation into how nop manages the task threading. Let us know if you find an answer.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.