From f53f93811122de3fb0ebc6b83cd606d077490247 Mon Sep 17 00:00:00 2001 From: tanimura-CAMP <103014323+tanimura-CAMP@users.noreply.github.com> Date: Sun, 11 Dec 2022 18:43:55 +0900 Subject: [PATCH 1/2] Update gcp-infra.js Resolving an issue where initial values are not set Signed-off-by: tanimura-CAMP <103014323+tanimura-CAMP@users.noreply.github.com> --- services/gcp-infra.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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( From e080b2ce5f45333bdd84a2786d0e93770d5d6e4f Mon Sep 17 00:00:00 2001 From: tanimura-CAMP <103014323+tanimura-CAMP@users.noreply.github.com> Date: Sun, 11 Dec 2022 18:51:33 +0900 Subject: [PATCH 2/2] Update stream.js Resolving issues with functions running concurrently Signed-off-by: tanimura-CAMP <103014323+tanimura-CAMP@users.noreply.github.com> --- controllers/stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'); });