Skip to content

Commit

Permalink
Don't block other party on redis result, fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Sep 23, 2024
1 parent cc04f10 commit be13791
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export class RedisStores {
await this.client.quit();
}
async storeTransaction({ thisParty, otherParty, amount }: { thisParty: string, otherParty: string, amount: number }): Promise<number> {
const newValueString = await this.client.incrByFloat(`${thisParty}:${otherParty}`, amount);
// don't wait for this to finish:
this.client.incrByFloat(`${thisParty}:${otherParty}`, amount);
// console.log('stored transaction', thisParty, otherParty, amount, newValueString);
return parseFloat(newValueString);
return amount;
}
}

0 comments on commit be13791

Please sign in to comment.