@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);
@@ -2756,5 +2760,5 @@ export {
2756
2760
  backfillSubgraph
2757
2761
  };
2758
2762
 
2759
- //# debugId=16E6F70B818734C264756E2164756E21
2763
+ //# debugId=4535BB1C7C6ABE3264756E2164756E21
2760
2764
  //# sourceMappingURL=reindex.js.map