Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/323490

Change subject: Edit stream should replay edits up to the maximum age
......................................................................

Edit stream should replay edits up to the maximum age

Change-Id: Ia25767eb0fe558e9d70170c7af02c9e37a65385e
---
M config.dev.yaml
M config.prod.yaml
M lib/edit-stream.js
3 files changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/trending-edits 
refs/changes/90/323490/1

diff --git a/config.dev.yaml b/config.dev.yaml
index 66944f7..e0200f6 100644
--- a/config.dev.yaml
+++ b/config.dev.yaml
@@ -83,6 +83,5 @@
         max_inactivity: 40 # maximum time in minutes a page can go without 
edits
         max_age: 1440 # maximum age allowed in minutes
         min_speed: 0 # minimum speed in edits per minute that a page is kept 
around
-      trending_period: 60 # Calculate trending for one hour
       min_edits: 6
       broker_list: localhost:9092
diff --git a/config.prod.yaml b/config.prod.yaml
index 1cfe4b8..c5095dc 100644
--- a/config.prod.yaml
+++ b/config.prod.yaml
@@ -83,6 +83,5 @@
         max_inactivity: 40 # maximum time in minutes a page can go without 
edits
         max_age: 1440 # maximum age allowed in minutes
         min_speed: 0.1 # minimum speed in edits per minute that a page is kept 
around
-      trending_period: 3600 # Calculate trending for one hour
       min_edits: 6
       broker_list: localhost:9092
diff --git a/lib/edit-stream.js b/lib/edit-stream.js
index dbbedec..c7d0066 100644
--- a/lib/edit-stream.js
+++ b/lib/edit-stream.js
@@ -108,7 +108,7 @@
         });
         this._commitQueue = [];
         this._commitInterval = setInterval(() => {
-            const cutoffDate = Date.now() - this._options.trending_period * 
1000;
+            const cutoffDate = Date.now() - this._options.max_age * 60 * 1000;
             while (this._commitQueue.length &&
                     this._commitQueue[0].timestamp <= cutoffDate) {
                 const commit = this._commitQueue.shift();

-- 
To view, visit https://gerrit.wikimedia.org/r/323490
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia25767eb0fe558e9d70170c7af02c9e37a65385e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/trending-edits
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to