from scripts import *
from api import app
from threading import Thread

USERNAME='API_USERNAME'
PASSWORD='API_PASSWORD'

def scan():
    while 1:
        start_scan(USERNAME, PASSWORD)
        time.sleep(2)

if __name__ == "__main__":
    try:
        t1 = Thread(target = scan)
        t2 = Thread(target = scan)
        t3 = Thread(target = scan)
        t1.setDaemon(True)
        t2.setDaemon(True)
        t3.setDaemon(True)
        t1.start()
        t2.start()
        t3.start()
        while True:
            pass
    except:
        logger.error('An error happened when run multi Threading!')
