Hi I am trying to test the delay functionality of Queues and I am unable to get it to work. The msg

Hi I am trying to test the delay functionality of Queues and I am unable to get it to work. The msg is consumed almost instantly.
export const producerTest = async (c) => {
  try {
      await c.env.TestQueue.send(JSON.stringify({
      slug: 'test123',
      timestamp: new Date().toISOString()
    }), { delaySeconds: 300 });
    return c.json('Queued', httpStatus.OK);
  } catch (error) {
    console.log(`Error in test ${error.message}`);
    const response = createResponse(
      {},
      {
        message: `Error occured in test ${error.message}`,
      }
    );
    return c.json(response, httpStatus.INTERNAL_SERVER_ERROR);
  }
};
Was this page helpful?