Hi,
is there a way I can check in my code that it’s running withing a job context? This code might be deep into my application logic, and not directly in the enqueued method.
Thanks.
Hi,
is there a way I can check in my code that it’s running withing a job context? This code might be deep into my application logic, and not directly in the enqueued method.
Thanks.
Not really. The method knows nothing about the environment it is executing in, and it actually shouldn’t care.
There’s a half-baked way to check if JobActivatorScope.Current
is not null, but it has a few problems: