Skip to content

Commit

Permalink
Merge pull request #502 from skalenetwork/fix-redis-wallet
Browse files Browse the repository at this point in the history
Fix redis wallet set with expiration
  • Loading branch information
badrogger authored Oct 25, 2022
2 parents 2ef5f87 + e1a4205 commit 6c65b77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions skale/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
DEFAULT_GAS_MULTIPLIER = float(os.getenv('DEFAULT_GAS_MULTIPLIER') or 1.2)
DEFAULT_PRIORITY = int(os.getenv('DEFAULT_PRIORITY') or 5)
NO_SYNC_TS_DIFF = int(os.getenv('NO_SYNC_TS_DIFF') or -1)
TXRECORD_EXPIRATION = int(os.getenv('TXRECORD_EXPIRATION') or 24 * 60 * 60) # 1 day
3 changes: 1 addition & 2 deletions skale/wallets/redis_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ def sign_and_send(
logger.info(f'Adding tx {raw_id} to the pool')
pipe.zadd(self.pool, {raw_id: score})
logger.info(f'Saving tx {raw_id} record: {tx_record}')
pipe.set(raw_id, tx_record)
pipe.expire(raw_id, tx_record)
pipe.set(raw_id, tx_record, ex=config.TXRECORD_EXPIRATION)
pipe.execute()
return self._to_id(raw_id)
except Exception as err:
Expand Down

0 comments on commit 6c65b77

Please sign in to comment.