mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-10 17:32:13 -04:00
storelocking: use sha256 for lock, not xxh64
This commit is contained in:
parent
11ab8fdcde
commit
a01907f79e
1 changed files with 2 additions and 3 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import datetime
|
||||
import hashlib
|
||||
import json
|
||||
import random
|
||||
import time
|
||||
|
||||
from xxhash import xxh64
|
||||
|
||||
from borgstore.store import ObjectNotFound
|
||||
|
||||
from . import platform
|
||||
|
|
@ -101,7 +100,7 @@ class Lock:
|
|||
timestamp = now.isoformat(timespec="milliseconds")
|
||||
lock = dict(exclusive=exclusive, hostid=self.id[0], processid=self.id[1], threadid=self.id[2], time=timestamp)
|
||||
value = json.dumps(lock).encode("utf-8")
|
||||
key = xxh64(value).hexdigest()
|
||||
key = hashlib.sha256(value).hexdigest()
|
||||
logger.debug(f"LOCK-CREATE: creating lock in store. key: {key}, lock: {lock}.")
|
||||
self.store.store(f"locks/{key}", value)
|
||||
if update_last_refresh:
|
||||
|
|
|
|||
Loading…
Reference in a new issue