mirror of
https://github.com/ostreedev/ostree.git
synced 2025-02-03 17:47:40 +03:00
lib/repo: Make locking timeout configurable
I want to make locking fully configurable (and probably off by default for now). This is a prep commit for that. Closes: #1375 Approved by: jlebon
This commit is contained in:
parent
bc3d80550b
commit
a9a9445582
@ -37,8 +37,6 @@ G_BEGIN_DECLS
|
||||
#define _OSTREE_MAX_OUTSTANDING_FETCHER_REQUESTS 8
|
||||
#define _OSTREE_MAX_OUTSTANDING_DELTAPART_REQUESTS 2
|
||||
|
||||
#define _OSTREE_DEFAULT_LOCK_TIMEOUT_SECONDS 30
|
||||
|
||||
/* In most cases, writing to disk should be much faster than
|
||||
* fetching from the network, so we shouldn't actually hit
|
||||
* this. But if using pipelining and e.g. pulling over LAN
|
||||
|
@ -1209,7 +1209,6 @@ ostree_repo_init (OstreeRepo *self)
|
||||
self->objects_dir_fd = -1;
|
||||
self->uncompressed_objects_dir_fd = -1;
|
||||
self->sysroot_kind = OSTREE_REPO_SYSROOT_KIND_UNKNOWN;
|
||||
self->lock_timeout_seconds = _OSTREE_DEFAULT_LOCK_TIMEOUT_SECONDS;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2734,6 +2733,15 @@ reload_core_config (OstreeRepo *self,
|
||||
self->tmp_expiry_seconds = g_ascii_strtoull (tmp_expiry_seconds, NULL, 10);
|
||||
}
|
||||
|
||||
{ g_autofree char *lock_timeout_seconds = NULL;
|
||||
|
||||
if (!ot_keyfile_get_value_with_default (self->config, "core", "lock-timeout-secs", "30",
|
||||
&lock_timeout_seconds, error))
|
||||
return FALSE;
|
||||
|
||||
self->lock_timeout_seconds = g_ascii_strtoull (lock_timeout_seconds, NULL, 10);
|
||||
}
|
||||
|
||||
{ g_autofree char *compression_level_str = NULL;
|
||||
|
||||
/* gzip defaults to 6 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user