You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Parses an error stack trace to extract file paths.
3
+
*
4
+
* @param err - The Error object containing the stack trace to parse
5
+
* @returns An array of normalized file paths extracted from the stack trace, with backslashes converted to forward slashes and null entries filtered out
6
+
*
7
+
* @example
8
+
* ```typescript
9
+
* const error = new Error('Something went wrong');
|`backend.driver`| Backend driver package name (SQLite, Postgres, MySQL, MongoDB) |`@sidequest/sqlite-backend`|
178
178
|`backend.config`| Backend-specific connection string or [Knex configuration object](https://knexjs.org/guide/#configuration-options)|`./sidequest.sqlite`|
179
+
|`dashboard.enabled`| Whether to enable the dashboard web interface |`true`|
180
+
|`dashboard.port`| Port for the dashboard web interface |`8678`|
181
+
|`dashboard.auth`| Basic auth configuration with `user` and `password`. If omitted, no auth is required. |`undefined`|
179
182
|`queues`| Array of queue configurations with name, concurrency, priority, and state |`[]`|
180
183
|`maxConcurrentJobs`| Maximum number of jobs processed simultaneously across all queues |`10`|
181
184
|`minThreads`| Minimum number of worker threads to use | Number of CPU cores |
@@ -192,6 +195,8 @@ await Sidequest.start({
192
195
|`gracefulShutdown`| Whether to enable graceful shutdown handling |`true`|
193
196
|`jobDefaults`| Default values for new jobs. Used while enqueueing |`undefined`|
194
197
|`queueDefaults`| Default values for auto-created queues |`undefined`|
198
+
|`manualJobResolution`| Whether to manually resolve job classes. See [Manual Job Resolution](/jobs/manual-resolution.md)|`false`|
199
+
|`jobsFilePath`| Optional path to the file where job classes are exported. Ignored if `manualJobResolution` is `false`. |`undefined`|
195
200
196
201
::: danger
197
202
If `auth` is not configured and `dashboard: true` is enabled in production, the dashboard will be publicly accessible. This is a security risk and **not recommended**.
Copy file name to clipboardExpand all lines: packages/docs/jobs/manual-resolution.md
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ When you see `sidequest.jobs.js` as the job script, it indicates that the job cl
28
28
When manual job resolution is enabled:
29
29
30
30
1.**Job Enqueuing**: Jobs are enqueued with `script: "sidequest.jobs.js"` instead of specific file paths
31
-
2.**Job Execution**: The runner looks for a `sidequest.jobs.js` file in the current directory or any parent directory
31
+
2.**Job Execution**: The runner looks for a `sidequest.jobs.js` file in the current directory or any parent directory. If the `jobsFilePath` configuration is set, it uses that path instead.
32
32
3.**Class Resolution**: Job classes are imported from the central registry file instead of individual script files
### Finding `sidequest.jobs.js` when `jobsFilePath` is not set
80
+
78
81
Sidequest searches for the `sidequest.jobs.js` file using the following strategy:
79
82
80
83
1.**Current Working Directory**: Starts from `process.cwd()`
@@ -126,6 +129,24 @@ For example:
126
129
In this case, since `sidequest.jobs.js` is at the `My Projects/` level, both worker projects can find it when they start up.
127
130
If this file exports all job classes used by both projects, everything will work seamlessly.
128
131
132
+
### Finding `sidequest.jobs.js` when `jobsFilePath` is set
133
+
134
+
If you set the `jobsFilePath` configuration option, Sidequest will use that exact path to locate the `sidequest.jobs.js` file.
135
+
This is useful if you want to place the file in a non-standard location or have multiple job registries for different environments.
136
+
137
+
If you provide an absolute path or file URL, Sidequest will use that directly.
138
+
However, if you provide a relative path, it will be resolved relative to the file that called `Sidequest.start` or `Sidequest.configure`.
139
+
140
+
For example, if you provide `jobsFilePath: "./config/sidequest.jobs.js"` in your main application file which is located at `/app/src/server.js`, Sidequest will look for the jobs file at `/app/src/config/sidequest.jobs.js`.
0 commit comments