@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 1.65 kB
Source Map (JSON)
{"version":3,"file":"get-adapter.mjs","names":["constants"],"sources":["../../../src/libs/queue/get-adapter.ts"],"sourcesContent":["import constants from \"../../constants/constants.js\";\nimport type { Config } from \"../../types/config.js\";\nimport logger from \"../logger/index.js\";\nimport type { AdapterRuntimeContext } from \"../runtime/types.js\";\nimport passthroughQueueAdapter from \"./adapters/passthrough.js\";\nimport type { QueueAdapterInstance } from \"./types.js\";\n\nconst getQueueAdapter = async (\n\tconfig: Config,\n\t_runtimeContext?: AdapterRuntimeContext,\n): Promise<QueueAdapterInstance> => {\n\ttry {\n\t\tif (config.queue?.adapter) {\n\t\t\tconst adapter =\n\t\t\t\ttypeof config.queue.adapter === \"function\"\n\t\t\t\t\t? await config.queue.adapter()\n\t\t\t\t\t: config.queue.adapter;\n\n\t\t\treturn await adapter;\n\t\t}\n\n\t\treturn passthroughQueueAdapter();\n\t} catch (error) {\n\t\tlogger.error({\n\t\t\terror,\n\t\t\tevent: \"queue-adapter.initialization.failed\",\n\t\t\tscope: constants.logScopes.queueAdapter,\n\t\t\tmessage: \"Failed to initialize queue adapter\",\n\t\t\tdata: {\n\t\t\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\t\t},\n\t\t});\n\t\treturn passthroughQueueAdapter();\n\t}\n};\n\nexport default getQueueAdapter;\n"],"mappings":"0HAOA,MAAM,EAAkB,MACvB,EACA,IACmC,CACnC,GAAI,CAUH,OATI,EAAO,OAAO,QAMV,MAJN,OAAO,EAAO,MAAM,SAAY,WAC7B,MAAM,EAAO,MAAM,QAAQ,EAC3B,EAAO,MAAM,SAKX,EAAwB,CAChC,OAAS,EAAO,CAUf,OATA,EAAO,MAAM,CACZ,QACA,MAAO,sCACP,MAAOA,EAAU,UAAU,aAC3B,QAAS,qCACT,KAAM,CACL,aAAc,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,CACpE,CACD,CAAC,EACM,EAAwB,CAChC,CACD"}