Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apify-api/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,8 @@ paths:
$ref: 'paths/request-queues/request-queues@{queueId}.yaml'
'/v2/request-queues/{queueId}/requests/batch':
$ref: 'paths/request-queues/request-queues@{queueId}@[email protected]'
'/v2/request-queues/{queueId}/requests/unlock':
$ref: 'paths/request-queues/request-queues@{queueId}@[email protected]'
'/v2/request-queues/{queueId}/requests':
$ref: 'paths/request-queues/request-queues@{queueId}@requests.yaml'
'/v2/request-queues/{queueId}/requests/{requestId}':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
post:
tags:
- Storage/Request queues/Requests locks
summary: Unlock requests
description: |
Unlocks requests in the queue for the client. The requests are unlocked if were locked by the same client key or if locked from the same Actor run.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand what this actually does. Does it unlock all requests locked from the same run, and (in addition to) all requests locked by the same client key (I assume to account for working with the RQ from a script outside of the platform)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if the client is within the Actor run it will unlock all request locked by this Actor run plus additionally all lock lock by the clientKey. If the client is outside if Actor run it will unlock just request locked by the same clientKey.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the description.

operationId: requestQueue_requests_unlock_post
parameters:
- name: queueId
in: path
description: Queue ID or `username~queue-name`.
required: true
style: simple
schema:
type: string
example: WkzbQMuFYuamGv3YF
- name: clientKey
in: query
description: |
A unique identifier of the client accessing the request queue. It must
be a string between 1 and 32 characters long
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, let's move this in separate PR as I need to update it everywhere 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, are you up to it or shall I make an issue? 🙂

style: form
explode: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, it's just a simple string query parameter, why style: form and explode: true?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly not sure, I just reused this param from the current rq endpoint see

schema:
type: string
example: client-abc
responses:
'200':
description: 'Number of requests that were unlocked'
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: object
required:
- unlockedCount
properties:
unlockedCount:
type: integer
description: 'Number of requests that were successfully unlocked'
example:
data:
unlockedCount: 10

deprecated: false
x-js-parent: RequestQueueClient
x-js-name: unlockRequests
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#unlockRequests
x-py-parent: RequestQueueClientAsync
x-py-name: unlock_requests
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#unlock_requests
Loading