@sixb/pg 0.2.0 → 0.2.1
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/index.js
CHANGED
|
@@ -21720,7 +21720,10 @@ function jsonText(value) {
|
|
|
21720
21720
|
// src/pg-pipeline-run-storage.ts
|
|
21721
21721
|
import { parseSixbFailure as parseSixbFailure4, serializeSixbFailure as serializeSixbFailure3 } from "@sixb/core/internal/errors";
|
|
21722
21722
|
import { assertPipelineRunExecution } from "@sixb/core/internal/pipeline-run-storage-provider";
|
|
21723
|
-
import {
|
|
21723
|
+
import {
|
|
21724
|
+
canFinishPipelineRun,
|
|
21725
|
+
canRequeuePipelineRunAfterEnqueueFailure
|
|
21726
|
+
} from "@sixb/core/internal/storage";
|
|
21724
21727
|
import { PIPELINE_RUN_FAILURE_CODES, PipelineRunError } from "@sixb/core/storage";
|
|
21725
21728
|
|
|
21726
21729
|
// src/latest-run-query.ts
|
|
@@ -21841,8 +21844,7 @@ class PgPipelineRunStorage {
|
|
|
21841
21844
|
if (!existing) {
|
|
21842
21845
|
throw new PipelineRunError(`[SixbPg] Pipeline run '${input.id}' not found for project '${input.projectId}'.`);
|
|
21843
21846
|
}
|
|
21844
|
-
|
|
21845
|
-
if (enqueueFailure && existing.status !== "queued" || !enqueueFailure && existing.status !== "running") {
|
|
21847
|
+
if (!canFinishPipelineRun(existing.status, input)) {
|
|
21846
21848
|
throw new PipelineRunError(`[SixbPg] Pipeline run '${input.id}' cannot finish from status '${existing.status}'.`);
|
|
21847
21849
|
}
|
|
21848
21850
|
const [updated] = input.status === "succeeded" ? await tx`
|
|
@@ -22873,7 +22875,7 @@ function toIsoString3(value) {
|
|
|
22873
22875
|
|
|
22874
22876
|
// src/pg-sync-run-storage.ts
|
|
22875
22877
|
import { parseSixbFailure as parseSixbFailure5, serializeSixbFailure as serializeSixbFailure5 } from "@sixb/core/internal/errors";
|
|
22876
|
-
import { canRequeueSyncRunAfterEnqueueFailure } from "@sixb/core/internal/storage";
|
|
22878
|
+
import { canFinishSyncRun, canRequeueSyncRunAfterEnqueueFailure } from "@sixb/core/internal/storage";
|
|
22877
22879
|
import { assertSyncRunExecution } from "@sixb/core/internal/sync-run-storage-provider";
|
|
22878
22880
|
import { SYNC_RUN_FAILURE_CODES, SyncRunError } from "@sixb/core/storage";
|
|
22879
22881
|
class PgSyncRunStorage {
|
|
@@ -22974,8 +22976,7 @@ class PgSyncRunStorage {
|
|
|
22974
22976
|
if (!existing) {
|
|
22975
22977
|
throw new SyncRunError(`[SixbPg] Sync run '${input.id}' not found for project '${input.projectId}'.`);
|
|
22976
22978
|
}
|
|
22977
|
-
|
|
22978
|
-
if (enqueueFailure && existing.status !== "queued" || !enqueueFailure && existing.status !== "running") {
|
|
22979
|
+
if (!canFinishSyncRun(existing.status, input)) {
|
|
22979
22980
|
throw new SyncRunError(`[SixbPg] Sync run '${input.id}' cannot finish from status '${existing.status}'.`);
|
|
22980
22981
|
}
|
|
22981
22982
|
if (input.status === "succeeded") {
|
|
@@ -24914,4 +24915,4 @@ export {
|
|
|
24914
24915
|
migratePostgresStorage
|
|
24915
24916
|
};
|
|
24916
24917
|
|
|
24917
|
-
//# debugId=
|
|
24918
|
+
//# debugId=CC63C3011793812064756E2164756E21
|