ソースを参照

fix using a removed function

Pouria Ezzati 1 年間 前
コミット
e3a88b9642
1 ファイル変更20 行追加22 行削除
  1. 20 22
      server/queues/visit.js

+ 20 - 22
server/queues/visit.js

@@ -25,29 +25,27 @@ module.exports = function({ data }) {
   
   tasks.push(query.link.incrementVisit({ id:  data.link.id }));
   
-  if (data.link.visit_count < getStatsLimit()) {
-    // the following line is for backward compatibility
-    // used to send the whole header to get the user agent
-    const userAgent = data.userAgent || data.headers?.["user-agent"];
-    const agent = useragent.parse(userAgent);
-    const [browser = "Other"] = browsersList.filter(filterInBrowser(agent));
-    const [os = "Other"] = osList.filter(filterInOs(agent));
-    const referrer =
-    data.referrer && removeWww(URL.parse(data.referrer).hostname);
-    const location = geoip.lookup(data.ip);
-    const country = location && location.country;
+  // the following line is for backward compatibility
+  // used to send the whole header to get the user agent
+  const userAgent = data.userAgent || data.headers?.["user-agent"];
+  const agent = useragent.parse(userAgent);
+  const [browser = "Other"] = browsersList.filter(filterInBrowser(agent));
+  const [os = "Other"] = osList.filter(filterInOs(agent));
+  const referrer =
+  data.referrer && removeWww(URL.parse(data.referrer).hostname);
+  const location = geoip.lookup(data.ip);
+  const country = location && location.country;
 
-    
-    tasks.push(
-      query.visit.add({
-        browser: browser.toLowerCase(),
-        country: country || "Unknown",
-        id: data.link.id,
-        os: os.toLowerCase().replace(/\s/gi, ""),
-        referrer: (referrer && referrer.replace(/\./gi, "[dot]")) || "Direct"
-      })
-    );
-  }
+  
+  tasks.push(
+    query.visit.add({
+      browser: browser.toLowerCase(),
+      country: country || "Unknown",
+      id: data.link.id,
+      os: os.toLowerCase().replace(/\s/gi, ""),
+      referrer: (referrer && referrer.replace(/\./gi, "[dot]")) || "Direct"
+    })
+  );
 
   return Promise.all(tasks);
 }