This commit is contained in:
Joey Hess 2024-07-04 15:26:05 -04:00
parent 2ca51fe947
commit 3f9569e27f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 13 additions and 29 deletions

View file

@ -115,13 +115,16 @@ the client sends:
The server responds with either SUCCESS or FAILURE. The server responds with either SUCCESS or FAILURE.
The former indicates the content is locked. It will remain The former indicates the content is locked. It will remain
locked until 10 minutes after the connection is broken, or until locked until the client sends:
the client sends:
UNLOCKCONTENT Key UNLOCKCONTENT Key
The server makes no response to that. The server makes no response to that.
If the connection is broken before the client sends UNLOCKCONTENT,
the content will remain locked for at least 10 minutes from when the server
sent SUCCESS.
## Removing content ## Removing content
To remove a key's content from the server, the client sends: To remove a key's content from the server, the client sends:

View file

@ -92,31 +92,12 @@ This request opens a websocket between the client and the server.
The server sends "SUCCESS" over the websocket once it has locked The server sends "SUCCESS" over the websocket once it has locked
the content. Or it sends "FAILURE" if it is unable to lock the content. the content. Or it sends "FAILURE" if it is unable to lock the content.
Once the server has sent "SUCCESS", the content remains locked as long as Once the server has sent "SUCCESS", the content remains locked
the client remains connected to the websocket. When the client disconnects, until the client sends "UNLOCKCONTENT" over the websocket.
or closes the websocket, the server unlocks the content.
XXX What happens if the connection times out? Will the client notice that If the client disconnects without sending "UNLOCKCONTENT", or the web
in time? How does this work with P2P over ssh? server gets shut down before it can receive that, the content will remain
locked for at least 10 minutes from when the server sent "SUCCESS".
### limit-remove
Limit the next requested removal of a key to occur within a specified
number of seconds.
Example:
> POST /git-annex/v3/limit-remove?seconds=600&key=SHA1--foo&clientuuid=79a5a1f4-07e8-11ef-873d-97f93ca91925&serveruuid=ecf6d4ca-07e8-11ef-8990-9b8c1f696bf6 HTTP/1.1
< SUCCESS
There are two required additional parameters, `key` and `seconds`.
The body of the request is empty.
The server responds with "SUCCESS".
The server will check the next `remove` request, and if it's for the same key,
and more time has elapsed, it will refuse to remove the key's content.
### remove ### remove
@ -156,9 +137,9 @@ Example:
This is the same as the `remove` request, but with an additional parameter, This is the same as the `remove` request, but with an additional parameter,
`timestamp`. `timestamp`.
If the server's clock is past the specified timestamp, the removal will If the server's monotonic clock is past the specified timestamp, the
fail. This is used to avoid removing content after a point in time where it removal will fail. This is used to avoid removing content after a point in
is no longer locked in other repostitories. time where it is no longer locked in other repostitories.
## gettimestamp ## gettimestamp