neosqlite 1.0.19 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/package.json +1 -1
- package/lib/src/jobs/index.js +3 -3
- package/package.json +1 -1
- package/src/jobs/index.ts +3 -3
package/lib/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neosqlite",
|
|
3
3
|
"description": "A lightweight wrapper around better-sqlite3 that adds developer-friendly features like job scheduling, migrations, error handling, query logging, SQL utilities, and more",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.20",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
package/lib/src/jobs/index.js
CHANGED
|
@@ -24,7 +24,7 @@ class NeosqliteJobs {
|
|
|
24
24
|
return this.options?.maxJobs ?? 10;
|
|
25
25
|
}
|
|
26
26
|
get processEvery() {
|
|
27
|
-
return this.options?.processEvery ??
|
|
27
|
+
return this.options?.processEvery ?? 5_000;
|
|
28
28
|
}
|
|
29
29
|
get maxRetries() {
|
|
30
30
|
return this.options?.maxRetries ?? 3;
|
|
@@ -170,7 +170,7 @@ class NeosqliteJobs {
|
|
|
170
170
|
try {
|
|
171
171
|
await Promise.resolve(handler.onRun());
|
|
172
172
|
this.db.write({
|
|
173
|
-
sql:
|
|
173
|
+
sql: "UPDATE " + this.jobsTable + " SET status = :status, updatedAt = CURRENT_TIMESTAMP WHERE id = :id",
|
|
174
174
|
args: { id, status: types_1.JobStatus.Completed },
|
|
175
175
|
});
|
|
176
176
|
// If this is a cronjob, schedule the next run
|
|
@@ -195,7 +195,7 @@ class NeosqliteJobs {
|
|
|
195
195
|
sql: (0, util_1.queryString)("UPDATE " + this.jobsTable, "SET status = :status, updatedAt = CURRENT_TIMESTAMP", "WHERE id = :id"),
|
|
196
196
|
args: { id, status: updatedStatus },
|
|
197
197
|
});
|
|
198
|
-
if (
|
|
198
|
+
if (handler.onFailure) {
|
|
199
199
|
await Promise.resolve(handler.onFailure(err));
|
|
200
200
|
}
|
|
201
201
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neosqlite",
|
|
3
3
|
"description": "A lightweight wrapper around better-sqlite3 that adds developer-friendly features like job scheduling, migrations, error handling, query logging, SQL utilities, and more",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.20",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
package/src/jobs/index.ts
CHANGED
|
@@ -30,7 +30,7 @@ export class NeosqliteJobs {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
private get processEvery() {
|
|
33
|
-
return this.options?.processEvery ??
|
|
33
|
+
return this.options?.processEvery ?? 5_000;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
private get maxRetries() {
|
|
@@ -245,7 +245,7 @@ export class NeosqliteJobs {
|
|
|
245
245
|
await Promise.resolve(handler.onRun());
|
|
246
246
|
|
|
247
247
|
this.db.write({
|
|
248
|
-
sql:
|
|
248
|
+
sql: "UPDATE " + this.jobsTable + " SET status = :status, updatedAt = CURRENT_TIMESTAMP WHERE id = :id",
|
|
249
249
|
args: { id, status: JobStatus.Completed },
|
|
250
250
|
});
|
|
251
251
|
|
|
@@ -277,7 +277,7 @@ export class NeosqliteJobs {
|
|
|
277
277
|
args: { id, status: updatedStatus },
|
|
278
278
|
});
|
|
279
279
|
|
|
280
|
-
if (
|
|
280
|
+
if (handler.onFailure) {
|
|
281
281
|
await Promise.resolve(handler.onFailure(err as Error));
|
|
282
282
|
}
|
|
283
283
|
}
|