@secondlayer/subgraphs 3.14.1 → 3.14.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.
@@ -1335,6 +1335,7 @@ import { resolveTraitContractIds } from "@secondlayer/shared/db/queries/contract
1335
1335
  import { advanceOperationCursor } from "@secondlayer/shared/db/queries/subgraph-operations";
1336
1336
  import {
1337
1337
  isByoSubgraph,
1338
+ recordLiveProgress,
1338
1339
  recordSubgraphProcessed,
1339
1340
  resolveSubgraphDb,
1340
1341
  updateSubgraphStatus
@@ -2029,7 +2030,7 @@ async function processBlock(subgraph, subgraphName, blockHeight, opts) {
2029
2030
  result.matched = matched.length;
2030
2031
  if (matched.length === 0) {
2031
2032
  if (!opts?.skipProgressUpdate) {
2032
- await updateSubgraphStatus(targetDb, subgraphName, "active", blockHeight);
2033
+ await recordLiveProgress(targetDb, subgraphName, blockHeight);
2033
2034
  }
2034
2035
  return result;
2035
2036
  }
@@ -2052,8 +2053,11 @@ async function processBlock(subgraph, subgraphName, blockHeight, opts) {
2052
2053
  const applyProgress = async (tx, rr) => {
2053
2054
  if (opts?.skipProgressUpdate)
2054
2055
  return;
2055
- const status = rr.errors > 0 && rr.processed === 0 ? "error" : "active";
2056
- await updateSubgraphStatus(tx, subgraphName, status, blockHeight);
2056
+ if (rr.errors > 0 && rr.processed === 0) {
2057
+ await updateSubgraphStatus(tx, subgraphName, "error", blockHeight);
2058
+ } else {
2059
+ await recordLiveProgress(tx, subgraphName, blockHeight);
2060
+ }
2057
2061
  if (rr.processed > 0 || rr.errors > 0) {
2058
2062
  const lastError = rr.errors > 0 ? `${rr.errors} error(s) at block ${blockHeight}` : undefined;
2059
2063
  await recordSubgraphProcessed(tx, subgraphName, rr.processed, rr.errors, lastError);
@@ -3515,5 +3519,5 @@ var shutdown = async () => {
3515
3519
  process.on("SIGINT", shutdown);
3516
3520
  process.on("SIGTERM", shutdown);
3517
3521
 
3518
- //# debugId=073CEA5B0977009764756E2164756E21
3522
+ //# debugId=86CD0D48124A797164756E2164756E21
3519
3523
  //# sourceMappingURL=service.js.map