@trafficgroup/knex-rel 0.1.23-rc.1 → 0.1.24
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/dist/dao/batch/batch.dao.d.ts +12 -0
- package/dist/dao/batch/batch.dao.js +60 -0
- package/dist/dao/batch/batch.dao.js.map +1 -1
- package/dist/interfaces/batch/batch.interfaces.d.ts +1 -0
- package/migrations/20260222140000_migration.ts +15 -0
- package/package.json +1 -1
- package/src/dao/batch/batch.dao.ts +68 -0
- package/src/interfaces/batch/batch.interfaces.ts +1 -0
|
@@ -18,6 +18,18 @@ export declare class BatchDAO implements IBaseDAO<IBatch> {
|
|
|
18
18
|
* Returns the updated batch with fresh counters.
|
|
19
19
|
*/
|
|
20
20
|
incrementFailed(id: number): Promise<IBatch>;
|
|
21
|
+
/**
|
|
22
|
+
* Atomically decrement completedVideos counter with row-level locking.
|
|
23
|
+
* Used when reprocessing a previously completed video.
|
|
24
|
+
* Returns the updated batch with fresh counters.
|
|
25
|
+
*/
|
|
26
|
+
decrementCompleted(id: number): Promise<IBatch>;
|
|
27
|
+
/**
|
|
28
|
+
* Atomically decrement failedVideos counter with row-level locking.
|
|
29
|
+
* Used when reprocessing a previously failed video.
|
|
30
|
+
* Returns the updated batch with fresh counters.
|
|
31
|
+
*/
|
|
32
|
+
decrementFailed(id: number): Promise<IBatch>;
|
|
21
33
|
/**
|
|
22
34
|
* Get batches by folder ID
|
|
23
35
|
*/
|
|
@@ -127,6 +127,66 @@ class BatchDAO {
|
|
|
127
127
|
}));
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Atomically decrement completedVideos counter with row-level locking.
|
|
132
|
+
* Used when reprocessing a previously completed video.
|
|
133
|
+
* Returns the updated batch with fresh counters.
|
|
134
|
+
*/
|
|
135
|
+
decrementCompleted(id) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
return this._knex.transaction((trx) => __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
const batch = yield trx("video_batch")
|
|
139
|
+
.where({ id })
|
|
140
|
+
.forUpdate()
|
|
141
|
+
.first();
|
|
142
|
+
if (!batch)
|
|
143
|
+
throw new Error(`Batch ${id} not found`);
|
|
144
|
+
const newCompleted = Math.max(0, batch.completedVideos - 1);
|
|
145
|
+
const updatePayload = {
|
|
146
|
+
completedVideos: newCompleted,
|
|
147
|
+
updated_at: trx.fn.now()
|
|
148
|
+
};
|
|
149
|
+
// Reset batch status if it was in a terminal state
|
|
150
|
+
if (batch.status === 'COMPLETED' || batch.status === 'FAILED') {
|
|
151
|
+
updatePayload.status = 'IN_PROGRESS';
|
|
152
|
+
}
|
|
153
|
+
yield trx("video_batch")
|
|
154
|
+
.where({ id })
|
|
155
|
+
.update(updatePayload);
|
|
156
|
+
return Object.assign(Object.assign({}, batch), { completedVideos: newCompleted, status: updatePayload.status || batch.status });
|
|
157
|
+
}));
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Atomically decrement failedVideos counter with row-level locking.
|
|
162
|
+
* Used when reprocessing a previously failed video.
|
|
163
|
+
* Returns the updated batch with fresh counters.
|
|
164
|
+
*/
|
|
165
|
+
decrementFailed(id) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
return this._knex.transaction((trx) => __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
const batch = yield trx("video_batch")
|
|
169
|
+
.where({ id })
|
|
170
|
+
.forUpdate()
|
|
171
|
+
.first();
|
|
172
|
+
if (!batch)
|
|
173
|
+
throw new Error(`Batch ${id} not found`);
|
|
174
|
+
const newFailed = Math.max(0, batch.failedVideos - 1);
|
|
175
|
+
const updatePayload = {
|
|
176
|
+
failedVideos: newFailed,
|
|
177
|
+
updated_at: trx.fn.now()
|
|
178
|
+
};
|
|
179
|
+
// Reset batch status if it was in a terminal state
|
|
180
|
+
if (batch.status === 'COMPLETED' || batch.status === 'FAILED') {
|
|
181
|
+
updatePayload.status = 'IN_PROGRESS';
|
|
182
|
+
}
|
|
183
|
+
yield trx("video_batch")
|
|
184
|
+
.where({ id })
|
|
185
|
+
.update(updatePayload);
|
|
186
|
+
return Object.assign(Object.assign({}, batch), { failedVideos: newFailed, status: updatePayload.status || batch.status });
|
|
187
|
+
}));
|
|
188
|
+
});
|
|
189
|
+
}
|
|
130
190
|
/**
|
|
131
191
|
* Get batches by folder ID
|
|
132
192
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.dao.js","sourceRoot":"","sources":["../../../src/dao/batch/batch.dao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,0EAA+C;AAE/C,MAAa,QAAQ;IAArB;QACY,UAAK,GAAyB,wBAAW,CAAC,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"batch.dao.js","sourceRoot":"","sources":["../../../src/dao/batch/batch.dao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,0EAA+C;AAE/C,MAAa,QAAQ;IAArB;QACY,UAAK,GAAyB,wBAAW,CAAC,aAAa,EAAE,CAAC;IAuOtE,CAAC;IArOS,MAAM,CAAC,IAAY;;YACrB,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACnF,OAAO,YAAY,CAAC;QACxB,CAAC;KAAA;IAEK,OAAO,CAAC,EAAU;;YACpB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;iBAC7C,SAAS,CAAC,cAAc,EAAE,YAAY,EAAE,MAAM,CAAC;iBAC/C,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;iBACxD,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;iBACjB,KAAK,EAA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gBACnB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE;aAClC,CAAC,CAAC;QACX,CAAC;KAAA;IAED;;OAEG;IACG,UAAU,CAAC,EAAU;;YACvB,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;iBAC1B,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC;iBACb,MAAM,CAAC;gBACJ,MAAM,EAAE,QAAQ;gBAChB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE;aAClC,CAAC,CAAC;QACX,CAAC;KAAA;CACJ;AAxOD,4BAwOC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Knex } from "knex";
|
|
2
|
+
|
|
3
|
+
export async function up(knex: Knex): Promise<void> {
|
|
4
|
+
await knex.schema.alterTable("video_batch", (table) => {
|
|
5
|
+
table.integer("previewVideoId").unsigned().nullable().references("id").inTable("video").onDelete("SET NULL");
|
|
6
|
+
table.index(["previewVideoId"], "idx_video_batch_preview_video_id");
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function down(knex: Knex): Promise<void> {
|
|
11
|
+
await knex.schema.alterTable("video_batch", (table) => {
|
|
12
|
+
table.dropIndex(["previewVideoId"], "idx_video_batch_preview_video_id");
|
|
13
|
+
table.dropColumn("previewVideoId");
|
|
14
|
+
});
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -116,6 +116,74 @@ export class BatchDAO implements IBaseDAO<IBatch> {
|
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Atomically decrement completedVideos counter with row-level locking.
|
|
121
|
+
* Used when reprocessing a previously completed video.
|
|
122
|
+
* Returns the updated batch with fresh counters.
|
|
123
|
+
*/
|
|
124
|
+
async decrementCompleted(id: number): Promise<IBatch> {
|
|
125
|
+
return this._knex.transaction(async (trx) => {
|
|
126
|
+
const batch = await trx("video_batch")
|
|
127
|
+
.where({ id })
|
|
128
|
+
.forUpdate()
|
|
129
|
+
.first();
|
|
130
|
+
|
|
131
|
+
if (!batch) throw new Error(`Batch ${id} not found`);
|
|
132
|
+
|
|
133
|
+
const newCompleted = Math.max(0, batch.completedVideos - 1);
|
|
134
|
+
|
|
135
|
+
const updatePayload: any = {
|
|
136
|
+
completedVideos: newCompleted,
|
|
137
|
+
updated_at: trx.fn.now()
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// Reset batch status if it was in a terminal state
|
|
141
|
+
if (batch.status === 'COMPLETED' || batch.status === 'FAILED') {
|
|
142
|
+
updatePayload.status = 'IN_PROGRESS';
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
await trx("video_batch")
|
|
146
|
+
.where({ id })
|
|
147
|
+
.update(updatePayload);
|
|
148
|
+
|
|
149
|
+
return { ...batch, completedVideos: newCompleted, status: updatePayload.status || batch.status };
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Atomically decrement failedVideos counter with row-level locking.
|
|
155
|
+
* Used when reprocessing a previously failed video.
|
|
156
|
+
* Returns the updated batch with fresh counters.
|
|
157
|
+
*/
|
|
158
|
+
async decrementFailed(id: number): Promise<IBatch> {
|
|
159
|
+
return this._knex.transaction(async (trx) => {
|
|
160
|
+
const batch = await trx("video_batch")
|
|
161
|
+
.where({ id })
|
|
162
|
+
.forUpdate()
|
|
163
|
+
.first();
|
|
164
|
+
|
|
165
|
+
if (!batch) throw new Error(`Batch ${id} not found`);
|
|
166
|
+
|
|
167
|
+
const newFailed = Math.max(0, batch.failedVideos - 1);
|
|
168
|
+
|
|
169
|
+
const updatePayload: any = {
|
|
170
|
+
failedVideos: newFailed,
|
|
171
|
+
updated_at: trx.fn.now()
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// Reset batch status if it was in a terminal state
|
|
175
|
+
if (batch.status === 'COMPLETED' || batch.status === 'FAILED') {
|
|
176
|
+
updatePayload.status = 'IN_PROGRESS';
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
await trx("video_batch")
|
|
180
|
+
.where({ id })
|
|
181
|
+
.update(updatePayload);
|
|
182
|
+
|
|
183
|
+
return { ...batch, failedVideos: newFailed, status: updatePayload.status || batch.status };
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
119
187
|
/**
|
|
120
188
|
* Get batches by folder ID
|
|
121
189
|
*/
|