Merge remote-tracking branch 'origin/S03-轨迹中台' into test

This commit is contained in:
dingenwen 2024-04-09 14:39:12 +08:00
commit 23406678f2
2 changed files with 8 additions and 2 deletions

View File

@ -70,6 +70,10 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
// 推送新增,需要根据上一次的推送 推断 本次推送 是否可行
config = await _trackPushCacheService.IsValidPushAsync(order.SubSystemId, order.CustomId,
order.LatestPushTrackCode, @event.TrackCode);
if (config is not { IsAutoPush: true })
{
config = null;
}
}
}
else

View File

@ -35,9 +35,11 @@ public class TrackPushCacheService : ITrackPushCacheService, ITransientDependenc
{
// maybe is null
var data = await DoGetPushContentConfigsAsync(subSystemId, customId);
var ttl = 3 * 24 * 60 * 60;
if (data == null) ttl = 5;
// ttl 3days
await RedisHelper.Client.SetAsync(TrackPushContentKey(subSystemId, customId),
data, 3 * 24 * 60 * 60);
data, ttl);
return data;
}
@ -66,7 +68,7 @@ public class TrackPushCacheService : ITrackPushCacheService, ITransientDependenc
// find swap
cache.FirstOrDefault(x => x.TrackCode == cache[idx + 1].SwapTrackCode);
return matched != null && matched.TrackCode == trackCode && matched.IsAutoPush ? matched : default;
return matched != null && matched.TrackCode == trackCode ? matched : default;
}
private async Task<List<TrackPushContentConfigDto>?> DoGetPushContentConfigsAsync(int subSystemId, int customId)