Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
clsync
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2015-03-29 15:21:49 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1f3b7bf4116d3a3121e248daef99953161609a57
1f3b7bf4
1 parent
f00df0f9
Added a "hold on" state (on "--standby-file" use)
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
ctx.h
main.c
sync.c
ctx.h
View file @
1f3b7bf
...
...
@@ -261,6 +261,7 @@ enum state_enum {
STATE_TERM
,
STATE_THREAD_GC
,
STATE_INITSYNC
,
STATE_HOLDON
,
STATE_UNKNOWN
};
typedef
enum
state_enum
state_t
;
...
...
main.c
View file @
1f3b7bf
...
...
@@ -357,6 +357,7 @@ static char *const status_descr[] = {
[
STATE_TERM
]
=
"terminating"
,
[
STATE_THREAD_GC
]
=
"thread gc"
,
[
STATE_INITSYNC
]
=
"initsync"
,
[
STATE_HOLDON
]
=
"hold on"
,
NULL
};
...
...
sync.c
View file @
1f3b7bf
...
...
@@ -3002,11 +3002,21 @@ int sync_idle(ctx_t *ctx_p, indexes_t *indexes_p) {
// Checking if we can sync
if
(
ctx_p
->
flags
[
STANDBYFILE
])
{
if
(
ctx_p
->
flags
[
STANDBYFILE
])
{
struct
stat
st
;
if
(
!
stat
(
ctx_p
->
standbyfile
,
&
st
))
{
if
(
!
stat
(
ctx_p
->
standbyfile
,
&
st
))
{
state_t
state_old
;
state_old
=
ctx_p
->
state
;
ctx_p
->
state
=
STATE_HOLDON
;
main_status_update
(
ctx_p
);
debug
(
1
,
"Found standby file. Holding over syncs. Sleeping "
XTOSTR
(
SLEEP_SECONDS
)
" second."
);
sleep
(
SLEEP_SECONDS
);
ctx_p
->
state
=
state_old
;
main_status_update
(
ctx_p
);
return
0
;
}
}
...
...
Please
register
or
login
to post a comment