diff --git a/skale/config.py b/skale/config.py index 57633ee6..bcf4619a 100644 --- a/skale/config.py +++ b/skale/config.py @@ -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 diff --git a/skale/wallets/redis_wallet.py b/skale/wallets/redis_wallet.py index 42256d8b..0916c1ef 100644 --- a/skale/wallets/redis_wallet.py +++ b/skale/wallets/redis_wallet.py @@ -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: