Unlocking only when locks exist
This commit is contained in:
parent
ac31de2388
commit
660e856986
|
@ -9,7 +9,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
|
||||||
AUTHOR="(C) 2013-2018 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2018 by Orsiris de Jong"
|
||||||
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
||||||
PROGRAM_VERSION=1.3.0-beta1
|
PROGRAM_VERSION=1.3.0-beta1
|
||||||
PROGRAM_BUILD=2018101001
|
PROGRAM_BUILD=2018101002
|
||||||
IS_STABLE=no
|
IS_STABLE=no
|
||||||
|
|
||||||
##### Execution order #__WITH_PARANOIA_DEBUG
|
##### Execution order #__WITH_PARANOIA_DEBUG
|
||||||
|
@ -686,6 +686,7 @@ function UnlockReplicas {
|
||||||
|
|
||||||
local initiatorPid
|
local initiatorPid
|
||||||
local targetPid
|
local targetPid
|
||||||
|
local unlockPids
|
||||||
|
|
||||||
if [ $_NOLOCKS == true ]; then
|
if [ $_NOLOCKS == true ]; then
|
||||||
return 0
|
return 0
|
||||||
|
@ -706,7 +707,20 @@ function UnlockReplicas {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$initiatorPid" -ne 0 ]; then
|
||||||
|
unlockPids=$initiatorPid
|
||||||
|
fi
|
||||||
|
if [ "$targetPid" -ne 0 ]; then
|
||||||
|
if [ "$unlockPids" -ne 0 ]; then
|
||||||
|
unlockPids"$unlockPids;$targetPid"
|
||||||
|
else
|
||||||
|
unlockPids="$targetPid"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$unlockPids" -ne 0 ]; then
|
||||||
ExecTasks "$initiatorPid;$targetPid" "${FUNCNAME[0]}" false 0 0 720 1800 true $SLEEP_TIME $KEEP_LOGGING
|
ExecTasks "$initiatorPid;$targetPid" "${FUNCNAME[0]}" false 0 0 720 1800 true $SLEEP_TIME $KEEP_LOGGING
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
###### Sync core functions
|
###### Sync core functions
|
||||||
|
|
Loading…
Reference in New Issue