mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
Refactors the API to run using dispatch instead of decorate
The API was never made an object since I couldn't find a way or working around the Flask decorators. By using dispatch we can get around the issues in #14 and will be able to create better mocks for the API
This commit is contained in:
@@ -5,7 +5,7 @@ from time import sleep
|
||||
from threading import Thread
|
||||
from cryptography.hazmat.primitives import serialization
|
||||
|
||||
from pisa.api import start_api
|
||||
from pisa.api import API
|
||||
from pisa.watcher import Watcher
|
||||
from pisa.tools import bitcoin_cli
|
||||
from pisa import HOST, PORT, c_logger
|
||||
@@ -40,7 +40,7 @@ def run_api(db_manager):
|
||||
)
|
||||
watcher = Watcher(db_manager, sk_der)
|
||||
|
||||
api_thread = Thread(target=start_api, args=[watcher])
|
||||
api_thread = Thread(target=API(watcher).start)
|
||||
api_thread.daemon = True
|
||||
api_thread.start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user