It seems background tasks can't see globals?

I think the problem is caused by the fact that the scope of the global variables is limited to a request.

If you want to load some global variable once and use it with the following requests, you should try keeping the server running. You can do this by opening any server module and checking this option :
image

The you need to be careful and make sure that the code running on different request threads don’t modify the data structure at the same time.

1 Like