add extra protection from null
This commit is contained in:
@@ -129,11 +129,11 @@ const writeToDlobRedis = async (userPnlMap: UserPnlMap): Promise<boolean> => {
|
|||||||
await Promise.all([
|
await Promise.all([
|
||||||
dlobRedisClient.setRaw(
|
dlobRedisClient.setRaw(
|
||||||
gainersRedisKey,
|
gainersRedisKey,
|
||||||
JSON.stringify(userPnlMap[perpMarketIndex].gain)
|
JSON.stringify(userPnlMap[perpMarketIndex].gain ?? [])
|
||||||
),
|
),
|
||||||
dlobRedisClient.setRaw(
|
dlobRedisClient.setRaw(
|
||||||
losersRedisKey,
|
losersRedisKey,
|
||||||
JSON.stringify(userPnlMap[perpMarketIndex].loss)
|
JSON.stringify(userPnlMap[perpMarketIndex].loss ?? [])
|
||||||
),
|
),
|
||||||
]).then(([_winnersResult, _losersResult]) => {
|
]).then(([_winnersResult, _losersResult]) => {
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|||||||
Reference in New Issue
Block a user