Skip to content

Commit

Permalink
fix status updates for filtered pools
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbronco committed Nov 17, 2023
1 parent 96e8e81 commit 3cf1cfc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/pool/lib/pool-on-chain-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,19 @@ export class PoolOnChainDataService {

const operations = [];
for (const pool of filteredPools) {
if (!state[pool.id]) continue; // Some pool types are filtered out in the state fetching function

const { isPaused, isInRecoveryMode } = state[pool.id];
if (pool.dynamicData) {
const data = pool.dynamicData;
if (data && data.isPaused !== isPaused && data.isInRecoveryMode !== isInRecoveryMode) {
operations.push(
prisma.prismaPoolDynamicData.update({
where: { id_chain: { id: pool.id, chain: this.options.chain } },
data: {
isPaused,
isInRecoveryMode,
},
}),
})
);
}
}
Expand Down

0 comments on commit 3cf1cfc

Please sign in to comment.