forked from hhy5277/dataflux-func
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_check_setup.py
More file actions
34 lines (24 loc) · 753 Bytes
/
_check_setup.py
File metadata and controls
34 lines (24 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
# Built-in Modules
import os
import sys
import time
# Project Modules
from worker.utils import yaml_resources, toolkit
CHECK_INTERVAL = 3
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
CONFIG_PATH = os.path.join(BASE_PATH, './config.yaml')
def get_config():
return yaml_resources.load_config(CONFIG_PATH)
def main():
if get_config().get('_DISABLE_SETUP'):
toolkit.sys_exit_ok()
while True:
config = get_config()
if config.get('_IS_INSTALLED'):
break
print(f"Waiting for setup, please open http://<IP or Hostname>:{config.get('WEB_PORT')}/ and continue")
time.sleep(CHECK_INTERVAL)
toolkit.sys_exit_ok()
if __name__ == '__main__':
main()