Posted on 22/09/2025 09:29:08
Same thing; HttpContext is null. I guess that's because it runs as a background thread where there is no context. I just remembered a similar issue from an index builder: https://doc.dynamicweb.com/forum/development/development/httpcontext-in-an-indexbuilderextender
For the dev team: Would it be an option to have some kind of storage (like a Dictionary<string, object> on a TableScript and other background tasks that exist for the lifetime of a single invocation? With HttpContext we had that; data would live for exactly one context which would mean my full lifecycle of the table script, index builder or what not.
With other solutions, I run the risk of storing data for too long or too short. I could for example cache my data for 10 minutes. If my job takes 20, I need to fetch the data twice. If I cache it for longer but the job runs quicker, I run the risk of stale data that has been updated by a previous run.
Any input would be highly appreciated.
Imar