You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building an admin/monitoring server that handles requests from both out production and qa Shopify store.
In the current setup, the user/password/site_uri are stored at the class level, so I can't create a prod session and a qa session and store them in memory.
For every request to the REST server I have to clear the current class variables and set for requested environment.
Additionally, this is not thread safe. If two REST requests arrive at the same time for different endpoints, they will clobber each other.
The text was updated successfully, but these errors were encountered:
+1 for this - very easy to solve this and will prevent unexpected behaviour for apps running under different environments (eg. threads vs processes, persistent vs cgi).
(maybe this wasn't in place when you raised this issue, I'm not sure)
@corby The sessions are actually in thread-local storage. I don't fully understand how it works (I'm reading about metaclasses now) but the ShopifyResource class somehow uses ShopifyResourceMeta properties, which are based on the _theadlocal object, an instance of threading.local.
I'm building an admin/monitoring server that handles requests from both out production and qa Shopify store.
In the current setup, the user/password/site_uri are stored at the class level, so I can't create a prod session and a qa session and store them in memory.
For every request to the REST server I have to clear the current class variables and set for requested environment.
Additionally, this is not thread safe. If two REST requests arrive at the same time for different endpoints, they will clobber each other.
The text was updated successfully, but these errors were encountered: