@secondlayer/subgraphs 3.7.0 → 3.7.2
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.
|
@@ -2516,7 +2516,11 @@ import {
|
|
|
2516
2516
|
updateSubgraphStatus as updateSubgraphStatus3
|
|
2517
2517
|
} from "@secondlayer/shared/db/queries/subgraphs";
|
|
2518
2518
|
import { logger as logger14 } from "@secondlayer/shared/logger";
|
|
2519
|
-
import {
|
|
2519
|
+
import {
|
|
2520
|
+
listen as listen2,
|
|
2521
|
+
sourceListenerUrl,
|
|
2522
|
+
targetListenerUrl as targetListenerUrl2
|
|
2523
|
+
} from "@secondlayer/shared/queue/listener";
|
|
2520
2524
|
|
|
2521
2525
|
// src/runtime/chain-reorg.ts
|
|
2522
2526
|
import { getTargetDb as getTargetDb5 } from "@secondlayer/shared/db";
|
|
@@ -2575,7 +2579,7 @@ import {
|
|
|
2575
2579
|
} from "@secondlayer/shared/db";
|
|
2576
2580
|
import { getSubscriptionSigningSecret } from "@secondlayer/shared/db/queries/subscriptions";
|
|
2577
2581
|
import { logger as logger11 } from "@secondlayer/shared/logger";
|
|
2578
|
-
import { listen } from "@secondlayer/shared/queue/listener";
|
|
2582
|
+
import { listen, targetListenerUrl } from "@secondlayer/shared/queue/listener";
|
|
2579
2583
|
import { sql as sql4 } from "kysely";
|
|
2580
2584
|
|
|
2581
2585
|
// src/runtime/formats/index.ts
|
|
@@ -3052,20 +3056,21 @@ async function startEmitter(opts) {
|
|
|
3052
3056
|
if (lastErr) {
|
|
3053
3057
|
throw new Error(`[emitter] matcher refresh failed ${MATCHER_BOOT_ATTEMPTS}×; aborting boot: ${lastErr instanceof Error ? lastErr.message : String(lastErr)}`);
|
|
3054
3058
|
}
|
|
3059
|
+
const listenUrl = targetListenerUrl();
|
|
3055
3060
|
const stopNew = await listen("subscriptions:new_outbox", () => {
|
|
3056
3061
|
if (!state.running)
|
|
3057
3062
|
return;
|
|
3058
3063
|
claimAndDrain(db, state, emitterId).catch((err) => logger11.error("[emitter] claim failed", {
|
|
3059
3064
|
error: err instanceof Error ? err.message : String(err)
|
|
3060
3065
|
}));
|
|
3061
|
-
});
|
|
3066
|
+
}, { connectionString: listenUrl });
|
|
3062
3067
|
const stopChanged = await listen("subscriptions:changed", () => {
|
|
3063
3068
|
if (!state.running)
|
|
3064
3069
|
return;
|
|
3065
3070
|
refreshMatcher(db).catch((err) => logger11.error("[emitter] matcher refresh failed", {
|
|
3066
3071
|
error: err instanceof Error ? err.message : String(err)
|
|
3067
3072
|
}));
|
|
3068
|
-
});
|
|
3073
|
+
}, { connectionString: listenUrl });
|
|
3069
3074
|
const poll = setInterval(() => {
|
|
3070
3075
|
if (!state.running)
|
|
3071
3076
|
return;
|
|
@@ -3392,12 +3397,6 @@ async function catchUpAll(subgraphs, db, concurrency) {
|
|
|
3392
3397
|
function handlerImportUrl(handlerPath, cacheBust = Date.now()) {
|
|
3393
3398
|
return `${pathToFileURL(resolve(handlerPath)).href}?t=${cacheBust}`;
|
|
3394
3399
|
}
|
|
3395
|
-
function sourceListenerUrl() {
|
|
3396
|
-
return process.env.SOURCE_DATABASE_URL ?? process.env.DATABASE_URL;
|
|
3397
|
-
}
|
|
3398
|
-
function targetListenerUrl() {
|
|
3399
|
-
return process.env.TARGET_DATABASE_URL ?? process.env.DATABASE_URL;
|
|
3400
|
-
}
|
|
3401
3400
|
function isHandlerNotFoundError(err) {
|
|
3402
3401
|
if (!(err instanceof Error))
|
|
3403
3402
|
return false;
|
|
@@ -3622,7 +3621,7 @@ async function startSubgraphOperationRunner(opts) {
|
|
|
3622
3621
|
await drain();
|
|
3623
3622
|
const stopListening = await listen2(CHANNEL_SUBGRAPH_OPERATIONS, () => {
|
|
3624
3623
|
drain();
|
|
3625
|
-
}, { connectionString:
|
|
3624
|
+
}, { connectionString: targetListenerUrl2() });
|
|
3626
3625
|
const pollInterval = setInterval(() => {
|
|
3627
3626
|
drain();
|
|
3628
3627
|
}, POLL_INTERVAL_MS);
|
|
@@ -3699,5 +3698,5 @@ export {
|
|
|
3699
3698
|
startSubgraphOperationRunner
|
|
3700
3699
|
};
|
|
3701
3700
|
|
|
3702
|
-
//# debugId=
|
|
3701
|
+
//# debugId=56C83299FAD4393564756E2164756E21
|
|
3703
3702
|
//# sourceMappingURL=processor.js.map
|