| | |
| | | # 设置账户信息 |
| | | def setAccountInfo(accountId, strategyId, token): |
| | | redis = redisManager.getRedis() |
| | | RedisUtils.set(redis, "juejin-account-id", accountId) |
| | | RedisUtils.set(redis, "juejin-strategy-id", strategyId) |
| | | RedisUtils.set(redis, "juejin-token", token) |
| | | try: |
| | | RedisUtils.set(redis, "juejin-account-id", accountId, auto_free=False) |
| | | RedisUtils.set(redis, "juejin-strategy-id", strategyId, auto_free=False) |
| | | RedisUtils.set(redis, "juejin-token", token, auto_free=False) |
| | | finally: |
| | | redis.connection_pool.disconnect() |
| | | |
| | | |
| | | def getAccountInfo(): |
| | | redis = redisManager.getRedis() |
| | | account_id = RedisUtils.get(redis, "juejin-account-id") |
| | | strategy_id = RedisUtils.get(redis, "juejin-strategy-id") |
| | | token = RedisUtils.get(redis, "juejin-token") |
| | | return account_id, strategy_id, token |
| | | try: |
| | | account_id = RedisUtils.get(redis, "juejin-account-id", auto_free=False) |
| | | strategy_id = RedisUtils.get(redis, "juejin-strategy-id", auto_free=False) |
| | | token = RedisUtils.get(redis, "juejin-token", auto_free=False) |
| | | return account_id, strategy_id, token |
| | | finally: |
| | | redis.connection_pool.disconnect() |
| | | |
| | | |
| | | def init_data(): |