mirror of
https://github.com/GothenburgBitFactory/taskchampion-sync-server.git
synced 2025-08-02 14:38:36 +02:00
Make storage transactions specific to a client_id (#67)
Transactions for different client_ids cannot interfere with one another, so this provides an opportunity for the sort of concurrency that a mult-client hosting solution might need. For example, a postgres backend could lock the client row in each transaction.
This commit is contained in:
parent
4029c03479
commit
1828a31a24
9 changed files with 246 additions and 319 deletions
|
@ -48,8 +48,8 @@ mod test {
|
|||
|
||||
// set up the storage contents..
|
||||
{
|
||||
let mut txn = storage.txn().unwrap();
|
||||
txn.new_client(client_id, Uuid::new_v4()).unwrap();
|
||||
let mut txn = storage.txn(client_id).unwrap();
|
||||
txn.new_client(Uuid::new_v4()).unwrap();
|
||||
txn.commit().unwrap();
|
||||
}
|
||||
|
||||
|
@ -75,10 +75,9 @@ mod test {
|
|||
|
||||
// set up the storage contents..
|
||||
{
|
||||
let mut txn = storage.txn().unwrap();
|
||||
txn.new_client(client_id, Uuid::new_v4()).unwrap();
|
||||
let mut txn = storage.txn(client_id).unwrap();
|
||||
txn.new_client(Uuid::new_v4()).unwrap();
|
||||
txn.set_snapshot(
|
||||
client_id,
|
||||
Snapshot {
|
||||
version_id,
|
||||
versions_since: 3,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue