質問

I have an asp.net website with a background service running that sends queued emails every minute. The problem is we moved to a web garden (multiple worker processes) and the emails get sent multiple times (at the very same time or close to it) because multiple threads are invoking that background process.

Is there a way to assign one thread or have only one thread run this process every minute and tell the other ones to ignore it?

Thanks!

役に立ちましたか?

解決

I had to use mutex locking to prevent this

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top