Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tyleroooo committed Jan 9, 2025
1 parent 07039f4 commit c0cf4e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/abacus-ts/lib/resourceCacheManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ResourceCacheManager<T, U> {
return;
}
if (entry.count <= 0) {
logAbacusTsError('ResourceCacheManager', 'tried to mark done key with no users', key);
logAbacusTsError('ResourceCacheManager', 'tried to mark done key with no subscribers', key);
entry.count = 1;
}

Expand All @@ -65,11 +65,7 @@ export class ResourceCacheManager<T, U> {
entry.destroyTimeout = setTimeout(() => {
const latestVal = this.cache[serializedKey];
if (!latestVal) {
logAbacusTsError(
'ResourceCacheManager',
'unexpectedly couldnt find resource to destroy',
key
);
logAbacusTsError('ResourceCacheManager', 'could not find resource to destroy', key);
return;
}

Expand Down
6 changes: 4 additions & 2 deletions src/abacus-ts/websocket/lib/indexerValueManagerHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { IndexerWebsocket } from './indexerWebsocket';
import { IndexerWebsocketManager } from './indexerWebsocketManager';
import { WebsocketDerivedValue } from './websocketDerivedValue';

// this is set to just above the websocket subscribe timeout because of race conditions in the indexer backend
const DESTROY_DELAY_MS = 21000;

type WebsocketValueCreator<Args, ReturnType> = (
websocket: IndexerWebsocket,
args: Args
Expand All @@ -27,8 +30,7 @@ export function makeWsValueManager<Args, ReturnType>(
// only ever pass the exact key type for correct behavior
keySerializer: (allArgs) => stableStringify(allArgs),

// this is set to just above the websocket subscribe timeout because of race conditions in the indexer backend
destroyDelayMs: 21000,
destroyDelayMs: DESTROY_DELAY_MS,
});
}

Expand Down

0 comments on commit c0cf4e2

Please sign in to comment.