chore(types): update workerMode tsdocs (#8269)
This commit is contained in:
@@ -372,19 +372,30 @@ export type ProjectConfigOptions = {
|
|||||||
jobsBatchSize?: number
|
jobsBatchSize?: number
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure the application's worker mode. Default is `shared`.
|
* Configure the application's worker mode.
|
||||||
|
*
|
||||||
|
* Workers are processes running separately from the main application. They're useful for executing long-running or resource-heavy tasks in the background, such as importing products.
|
||||||
|
*
|
||||||
|
* With a worker, these tasks are offloaded to a separate process. So, they won't affect the performance of the main application.
|
||||||
|
*
|
||||||
|
* 
|
||||||
|
*
|
||||||
|
* Medusa has three runtime modes:
|
||||||
*
|
*
|
||||||
* - Use `shared` to run the application in a single process.
|
* - Use `shared` to run the application in a single process.
|
||||||
* - Use `worker` to run the a worker process only.
|
* - Use `worker` to run the a worker process only.
|
||||||
* - Use `server` to run the application server only.
|
* - Use `server` to run the application server only.
|
||||||
*
|
*
|
||||||
* Learn more in [this guide](https://docs.medusajs.com/development/medusa-worker).
|
* In production, it's recommended to deploy two instances:
|
||||||
|
*
|
||||||
|
* 1. One having the `workerMode` configuration set to `server`.
|
||||||
|
* 2. Another having the `workerMode` configuration set to `worker`.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```js title="medusa-config.js"
|
* ```js title="medusa-config.js"
|
||||||
* module.exports = defineConfig({
|
* module.exports = defineConfig({
|
||||||
* projectConfig: {
|
* projectConfig: {
|
||||||
* workerMode: "shared"
|
* workerMode: process.env.WORKER_MODE || "shared"
|
||||||
* // ...
|
* // ...
|
||||||
* },
|
* },
|
||||||
* // ...
|
* // ...
|
||||||
|
|||||||
Reference in New Issue
Block a user