diff --git a/controllers/stream.js b/controllers/stream.js index 95283af..dc38742 100644 --- a/controllers/stream.js +++ b/controllers/stream.js @@ -49,7 +49,7 @@ router.get("/poll/:frequency/:delay", function (req, res) { } }) - }, req.params.delay); + }, req.params.delay * i); } res.send('polling Tweets from PubSub'); }); diff --git a/services/gcp-infra.js b/services/gcp-infra.js index 41587a5..4c9ba7a 100644 --- a/services/gcp-infra.js +++ b/services/gcp-infra.js @@ -7,7 +7,7 @@ const fs = require('fs'); const pubSubClient = new PubSub(); const subClient = new v1.SubscriberClient(); -var counter; +var counter = 0; async function synchronousPull(projectId, subscriptionName, maxMessagesToPull) { const formattedSubscription = subClient.subscriptionPath(