Skip to content

Commit 983ad20

Browse files
committed
feat(request-queue): Improve naming
1 parent 540a8a6 commit 983ad20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sources/platform/storage/request_queue.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ const requestQueueClient = client.requestQueue(requestQueue.id, {
515515
// Get all requests from the queue and check one locked by the first Actor.
516516
const requests = await requestQueueClient.listRequests();
517517
const requestsLockedByAnotherRun = requests.items.filter((request) => request.lockByClient === 'requestqueueone');
518-
const requestLockedByAnotherRun = await requestQueueClient.getRequest(
518+
const requestLockedByAnotherRunDetail = await requestQueueClient.getRequest(
519519
requestsLockedByAnotherRun[0].id,
520520
);
521521
@@ -527,16 +527,16 @@ const processingRequestsClientTwo = await requestQueueClient.listAndLockHead(
527527
},
528528
);
529529
const wasBothRunsLockedSameRequest = !!processingRequestsClientTwo.items.find(
530-
(request) => request.id === requestLockedByAnotherRun.id,
530+
(request) => request.id === requestLockedByAnotherRunDetail.id,
531531
);
532532
533533
console.log(`Was the request locked by the first run locked by the second run? ${wasBothRunsLockedSameRequest}`);
534-
console.log(`Request locked until ${requestLockedByAnotherRun?.lockExpiresAt}`);
534+
console.log(`Request locked until ${requestLockedByAnotherRunDetail?.lockExpiresAt}`);
535535
536536
// Other clients cannot modify the lock; attempting to do so will throw an error.
537537
try {
538538
await requestQueueClient.prolongRequestLock(
539-
requestLockedByAnotherRun.id,
539+
requestLockedByAnotherRunDetail.id,
540540
{ lockSecs: 60 },
541541
);
542542
} catch (err) {

0 commit comments

Comments
 (0)