dodo hold před 2 měsíci
rodič
revize
12df39b1b1

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
molilian.api/Properties/PublishProfiles/latest.pubxml.user


+ 17 - 2
molilian.core/Core/TracksCore.cs

@@ -24,6 +24,7 @@ namespace molilian.core
         private const int HourlyExpireSeconds = 7 * 86400; // keep a week of hourly buckets
         private const string DefaultDimensionValue = "";
         private const int LinkCacheExpireSeconds = 30 * 86400;
+        private const string LinkCacheVersion = "v2";
         private const string TrackRequestLogKey = ":tracks:request:logs";
         private static readonly HashSet<string> SupportEventTypes = new(StringComparer.OrdinalIgnoreCase) { "expose", "click" };
 
@@ -224,6 +225,20 @@ namespace molilian.core
                     if (link != null) linkCache[trackId] = link;
                 }
 
+                if (link != null)
+                {
+                    string linkEventType = NormalizeEventType(link.event_type);
+                    if (!SupportEventTypes.Contains(linkEventType)) continue;
+                    if (!string.Equals(eventType, linkEventType, StringComparison.OrdinalIgnoreCase))
+                    {
+                        _ = new LoggerLibrary("TracksCore", "FlushDaily")
+                            .Info($"skip stale track bucket: member={member}, link_event_type={linkEventType}", string.Empty)
+                            .SaveAsync();
+                        continue;
+                    }
+                    eventType = linkEventType;
+                }
+
                 string reportScene = ResolveMetricScene(link, memberScene);
                 string bucketKey = BuildMetricIndexValue(eventType, trackId, reportScene, accountId);
                 if (!buckets.TryGetValue(bucketKey, out var bucket))
@@ -388,12 +403,12 @@ ON DUPLICATE KEY UPDATE
             typename = Normalize(typename);
             scene = NormalizeOrAll(scene);
             uniqueId = NormalizeOrAll(uniqueId);
-            return $"{RedisPrefix}:link:{eventType}:{platform}:{typename}:{scene}:{uniqueId}";
+            return $"{RedisPrefix}:cache:{LinkCacheVersion}:link:{eventType}:{platform}:{typename}:{scene}:{uniqueId}";
         }
 
         public static string GetLinkIdCacheKey(int trackId)
         {
-            return $"{RedisPrefix}:linkid:{trackId}";
+            return $"{RedisPrefix}:cache:{LinkCacheVersion}:linkid:{trackId}";
         }
 
         public static async Task<TrackLinkDTO> GetLinkByIdAsync(int trackId)

+ 1 - 1
molilian.core/DTO/alimama/TkPoolDTO.cs

@@ -22,7 +22,7 @@
         public string user_agent { get; set; } = string.Empty;
         public DateTime create_time { get; set; } = DateTime.Now;
         public DateTime last_time { get; set; } = DateTime.Now;
-        public DateTime login_time { get; set; } = DateTime.Now;
+        public DateTime? login_time { get; set; }
         public bool status { get; set; }
         public string suspended_endpoint { get; set; } = string.Empty;
         public string nodeName { get; set; } = string.Empty;

+ 1 - 1
molilian.core/DTO/jd/JdPoolDTO.cs

@@ -25,7 +25,7 @@ namespace molilian.core
         public string app_secret { get; set; } = string.Empty;
         public DateTime create_time { get; set; } = DateTime.Now;
         public DateTime last_time { get; set; } = DateTime.Now;
-        public DateTime login_time { get; set; } = DateTime.Now;
+        public DateTime? login_time { get; set; }
         public bool status { get; set; }
         public JdUnionWorkMode work_mode { get; set; } = JdUnionWorkMode.SiteApi;
         public string user_agent { get; set; } = string.Empty;

+ 1 - 1
molilian.core/DTO/pdd/PddPoolDTO.cs

@@ -29,7 +29,7 @@ namespace molilian.core
         public string description { get; set; } = string.Empty;
         public DateTime create_time { get; set; } = DateTime.Now;
         public DateTime last_time { get; set; } = DateTime.Now;
-        public DateTime login_time { get; set; } = DateTime.Now;
+        public DateTime? login_time { get; set; }
         public bool status { get; set; } = false;
         public bool cookie_status { get; set; } = false;
         public PddUnionWorkMode work_mode { get; set; } = PddUnionWorkMode.SiteApi;

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů