Skip to content

Commit 2919695

Browse files
committed
update logic in slow app for poll_count as it was previously only returning 1
1 parent 4785b42 commit 2919695

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docker/async-slowapp/src/handlers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ async function delete_poll(req, res, next) {
262262
respond(req, res, next, 200);
263263
}
264264

265-
265+
let poll_counter = 0;
266266
async function poll(req, res, next) {
267267

268268
let poll_id = req.query.id;
@@ -273,7 +273,7 @@ async function poll(req, res, next) {
273273
let poll_count = cookies['poll-count'];
274274

275275
if (poll_count !== undefined) {
276-
poll_count = (parseInt(poll_count.split('=')[1]) + 1).toString();
276+
poll_counter++
277277
}
278278

279279
if (!(poll_id in locals.tracked)) {
@@ -291,7 +291,7 @@ async function poll(req, res, next) {
291291
let resp_headers = new MultiValueHeaders();
292292

293293
if (poll_count !== undefined) {
294-
resp_headers.withNewCookies({"poll-count": `poll-count=${poll_count}`}, 'set-cookie');
294+
resp_headers.withNewCookies({"poll-count": `poll-count=${poll_counter}`}, 'set-cookie');
295295
}
296296

297297
delete locals.tracked[poll_id];

0 commit comments

Comments
 (0)