@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.
package/dist/src/index.js CHANGED
@@ -1413,6 +1413,7 @@ import { resolveTraitContractIds } from "@secondlayer/shared/db/queries/contract
1413
1413
  import { advanceOperationCursor } from "@secondlayer/shared/db/queries/subgraph-operations";
1414
1414
  import {
1415
1415
  isByoSubgraph,
1416
+ recordLiveProgress,
1416
1417
  recordSubgraphProcessed,
1417
1418
  resolveSubgraphDb,
1418
1419
  updateSubgraphStatus
@@ -2107,7 +2108,7 @@ async function processBlock(subgraph, subgraphName, blockHeight, opts) {
2107
2108
  result.matched = matched.length;
2108
2109
  if (matched.length === 0) {
2109
2110
  if (!opts?.skipProgressUpdate) {
2110
- await updateSubgraphStatus(targetDb, subgraphName, "active", blockHeight);
2111
+ await recordLiveProgress(targetDb, subgraphName, blockHeight);
2111
2112
  }
2112
2113
  return result;
2113
2114
  }
@@ -2130,8 +2131,11 @@ async function processBlock(subgraph, subgraphName, blockHeight, opts) {
2130
2131
  const applyProgress = async (tx, rr) => {
2131
2132
  if (opts?.skipProgressUpdate)
2132
2133
  return;
2133
- const status = rr.errors > 0 && rr.processed === 0 ? "error" : "active";
2134
- await updateSubgraphStatus(tx, subgraphName, status, blockHeight);
2134
+ if (rr.errors > 0 && rr.processed === 0) {
2135
+ await updateSubgraphStatus(tx, subgraphName, "error", blockHeight);
2136
+ } else {
2137
+ await recordLiveProgress(tx, subgraphName, blockHeight);
2138
+ }
2135
2139
  if (rr.processed > 0 || rr.errors > 0) {
2136
2140
  const lastError = rr.errors > 0 ? `${rr.errors} error(s) at block ${blockHeight}` : undefined;
2137
2141
  await recordSubgraphProcessed(tx, subgraphName, rr.processed, rr.errors, lastError);
@@ -4023,5 +4027,5 @@ export {
4023
4027
  ByoBreakingChangeError
4024
4028
  };
4025
4029
 
4026
- //# debugId=9ABB4400810C6A0464756E2164756E21
4030
+ //# debugId=8B1D7AE53DBBA74F64756E2164756E21
4027
4031
  //# sourceMappingURL=index.js.map