mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-03 06:13:02 +02:00
libsrx: promote SYSREPO_TIMEOUT to srx/common.h
The 60 second timeout for datastore operations was defined locally in test-mode, and hard-coded in confd's factory reset RPC. Make it available to all services. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@ static int rpc(sr_session_ctx_t *session, uint32_t sub_id, const char *xpath,
|
||||
DEBUG("%s", xpath);
|
||||
|
||||
sr_session_switch_ds(session, SR_DS_RUNNING);
|
||||
rc = sr_copy_config(session, NULL, SR_DS_FACTORY_DEFAULT, 60000);
|
||||
rc = sr_copy_config(session, NULL, SR_DS_FACTORY_DEFAULT, SYSREPO_TIMEOUT);
|
||||
if (rc) {
|
||||
sr_session_set_netconf_error(session, "application", "operation-failed",
|
||||
NULL, xpath, sr_strerror(rc), 0);
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
|
||||
extern int debug;
|
||||
|
||||
/*
|
||||
* Default timeout (ms) for sysrepo operations, same as our frontends.
|
||||
* Use instead of 0 -- callbacks may be starved out on loaded systems.
|
||||
*/
|
||||
#define SYSREPO_TIMEOUT 60000
|
||||
|
||||
/* In IETF referred to LOG_AUDIT */
|
||||
#ifndef LOG_AUDIT
|
||||
#define LOG_AUDIT (13<<3) /* Log audit, for audit trails */
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <limits.h>
|
||||
|
||||
#include <srx/common.h>
|
||||
#define SYSREPO_TIMEOUT 60000 /* 60s, this is the timeout we use in our frontends. */
|
||||
|
||||
sr_subscription_ctx_t *sub = NULL;
|
||||
sr_conn_ctx_t *conn;
|
||||
|
||||
Reference in New Issue
Block a user