Skip to content

Commit

Permalink
add basic config lock between autoconf and scheduler + remove reverse…
Browse files Browse the repository at this point in the history
…-proxy tests for linux
  • Loading branch information
fl0ppy-d1sk committed Aug 31, 2023
1 parent cf55ade commit c206daf
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 49 deletions.
10 changes: 0 additions & 10 deletions examples/reverse-proxy-multisite/setup-linux.sh

This file was deleted.

2 changes: 1 addition & 1 deletion examples/reverse-proxy-multisite/tests.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reverse-proxy-multisite",
"kinds": ["docker", "autoconf", "swarm", "kubernetes", "linux"],
"kinds": ["docker", "autoconf", "swarm", "kubernetes"],
"timeout": 60,
"delay": 90,
"tests": [
Expand Down
14 changes: 0 additions & 14 deletions examples/reverse-proxy-multisite/variables.env

This file was deleted.

12 changes: 0 additions & 12 deletions examples/reverse-proxy-singlesite/setup-linux.sh

This file was deleted.

2 changes: 1 addition & 1 deletion examples/reverse-proxy-singlesite/tests.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reverse-proxy-singlesite",
"kinds": ["docker", "autoconf", "swarm", "linux"],
"kinds": ["docker", "autoconf", "swarm"],
"delay": 120,
"timeout": 60,
"no_copy_container": true,
Expand Down
11 changes: 0 additions & 11 deletions examples/reverse-proxy-singlesite/variables.env

This file was deleted.

14 changes: 14 additions & 0 deletions src/autoconf/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ def apply(self, instances, services, configs={}, first=False) -> bool:
)
sleep(5)

# wait until changes are applied
while True:
changes = self._db.check_changes()
if isinstance(changes, str):
self.__logger.error(
f"An error occurred when checking for changes in the database : {changes}"
)
elif not any(changes.values()):
break
else:
self.__logger.warning(
"Scheduler is already applying a configuration, retrying in 5 seconds ...",
)
sleep(5)
# update instances in database
if updates["instances"]:
err = self._db.update_instances(self.__instances, changed=False)
Expand Down

0 comments on commit c206daf

Please sign in to comment.