Skip to content

Commit 2161c07

Browse files
committed
- Make resolveDockerIPToDomain to be synchronized
1 parent 187e4df commit 2161c07

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

serius/serius.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import serius.watcher.dockerWatcher as dockerWatcher
1010
import serius.watcher.rancherWatcher as rancherWatcher
1111
import sys
12+
from threading import Lock
1213

1314
# Home Path
1415
homePath = str(Path.home())
@@ -28,9 +29,14 @@
2829
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(name)s.%(funcName)s +%(lineno)s: %(levelname)-3s [%(process)d] %(message)s")
2930
log = logging.getLogger('Serius')
3031

32+
# Lock
33+
lock = Lock()
34+
3135
# IP Resolver
3236
def resolveDockerIPToDomain(configFileJson):
3337

38+
lock.acquire()
39+
3440
if os.path.exists(hostsBackup):
3541

3642
copyfile(hostsBackup, hostsWrite)
@@ -99,6 +105,7 @@ def resolveDockerIPToDomain(configFileJson):
99105

100106
log.info("Nothing changed")
101107

108+
lock.release()
102109

103110
# Main
104111

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
setup(
1010
name='serius',
1111

12-
version='1.2.1',
12+
version='1.2.2',
1313

1414
description='Microservice Docker DNS for Local Linux',
1515

0 commit comments

Comments
 (0)