2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-25 20:11:06 +00:00
Commit Graph

10 Commits

Author SHA1 Message Date
Alexander Neumann
5b21d67a49 lock_test: correct merge error, use offset 500k 2015-08-19 20:25:59 +02:00
Alexander Neumann
cd4cc1daec Merge pull request #261 from restic/fix-260
locks: fix testing stale locks created on other hosts
2015-08-18 22:53:52 +02:00
Alexander Neumann
fbe746c261 locks: fix testing stale locks created on other hosts
Closes #260
2015-08-16 16:24:04 +02:00
Klaus Post
3804bc7493 Use bigger offset in test to avoid random test failures.
Since Windows cannot to a SIGHUP test to check if a process is live,
the test will fail because the lock isn't detected as stale if a process with
that ID exists. Process IDs are re-used agressively on Windows, so add 500000 makes
the test extremely unlikely (if not impossible) to fail.
2015-08-14 15:19:45 +02:00
Alexander Neumann
5cdcc99eba Use array instead of hash for backend.ID
Since backend.ID is always a slice of constant length, use an array
instead of a slice. Mostly, arrays behave as slices, except that an
array cannot be nil, so use `*backend.ID` insteaf of `backend.ID` in
places where the absence of an ID is possible (e.g. for the Subtree of a
Node, which may not present when the node is a file node).

This change allows to directly use backend.ID as the the key for a map,
so that arbitrary data structures (e.g. a Set implemented as a
map[backend.ID]struct{}) can easily be formed.
2015-07-25 18:01:57 +02:00
Alexander Neumann
781ec903e8 lock: add Refresh method 2015-07-12 21:02:00 +02:00
Alexander Neumann
0f09a7e46e Remove unreliable tests 2015-06-28 16:27:17 +02:00
Alexander Neumann
e657287eac cmd/restic: Add command unlock, improve error message 2015-06-28 13:52:23 +02:00
Alexander Neumann
fba912440d Add lock conflict check 2015-06-28 13:52:22 +02:00
Alexander Neumann
d51fd436b5 Add locking functions 2015-06-28 13:52:22 +02:00