Beispiel #1
0
import time
import psutil
import sys
import signal

from concurrent.futures import ThreadPoolExecutor

from app import (
    app,
    CreateApp,
)
from app.symbol import RunSymbol
from app.general.exchange_info import exchange_info
from system.db import Mysql

CreateApp()


async def startup():
    print("-" * 5, " STARTUP ", "-" * 5)

    return [await exchange_info()]


async def shutdown():
    print("-" * 5, " SHUTDOWN ", "-" * 5)
    await app.db.execute("TRUNCATE TABLE running")


async def active_symbols():
    system_pids = [str(x) for x in psutil.pids()]
Beispiel #2
0
import sys
from app import CreateApp
from time import sleep
from flask import Flask, render_template
import logging

app = CreateApp('config')

if __name__ == '__main__':
	app.run(host=app.config['HOST'], port=app.config['PORT'], debug=app.config['DEBUG'])
Beispiel #3
0
from app import CreateApp

app = CreateApp()
Beispiel #4
0
import sys
from app import CreateApp
from time import sleep
from flask import Flask, render_template
import logging

app = None
if (sys.argv[1] == "db"):
    appType = 0
else:
    appType = int(sys.argv[1])
print(appType)
if appType == 0:
    app = CreateApp('configclient', appType)
    logging.basicConfig(filename='errorClient.txt', level=logging.DEBUG)
else:
    app = CreateApp('configadmin', appType)
    logging.basicConfig(filename='errorAdmin.txt', level=logging.DEBUG)

print(app.config['PORT'])

if __name__ == '__main__':
    app.run(host=app.config['HOST'],
            port=app.config['PORT'],
            debug=app.config['DEBUG'])