Explorar o código

Add utility to get stats limit

poeti8 %!s(int64=6) %!d(string=hai) anos
pai
achega
05af1f8fce
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      server/utils/index.js

+ 3 - 0
server/utils/index.js

@@ -17,6 +17,9 @@ exports.isAdmin = email =>
     .map(e => e.trim())
     .includes(email);
 
+exports.getStatsLimit = url =>
+  url.user.statsLimit || Number(process.env.DEFAULT_MAX_STATS_PER_LINK) || 10000000;
+
 exports.getStatsCacheTime = total => {
   switch (true) {
     case total <= 5000: