Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to initialize a background process at the Shopify app start up with Remix Template

How to initialize a background process at the Shopify app start up with Remix Template

Da2
Shopify Partner
8 0 0

I am writing a Shopify plugin with Shopify remix template.

I have a requirement to initialize a queue consumer at the remix app start up. I cannot rely on user sending UI requests to the app. I am not sure where should I add the implementation for initializing the queue consumer? I tried adding my code for consuming queues to shopify.server.ts and entry.server.ts files. But all of them are executed when a UI request is received, not after the server startup. Is there a way that I can achieve this with Shopify remix template application ? 

Replies 0 (0)