Run a function once when a worker starts
I have some code that I only want to run once when my serverless worker starts (i.e not everytime a request is made). What is the best way of doing this? Just executing the code outside of the handler?
1 Reply
Never mind, found the answer here: https://docs.runpod.io/serverless/workers/handlers/overview#basic-handler-function
Overview | RunPod Documentation
Create and deploy serverless Handler Functions with RunPod, processing submitted inputs and generating output without managing server infrastructure, ideal for efficient, cost-effective, and rapid deployment of code.