I cache my D1 connection like this (on workers): ```js let cached_db = null; export const useDb = (

I cache my D1 connection like this (on workers):

let cached_db = null;
export const useDb = () => {
  if (!cached_db) {
    const binding = process?.env?.DB || globalThis?.__env__?.DB || globalThis?.DB
    cached_db = drizzle(binding, { schema })
  }
  return cached_db
}

Can this be the cause of:

[request error] [unhandled] [500] D1_ERROR: D1 DB storage operation exceeded timeout which caused object to be reset. 
Was this page helpful?