Remove Rocketry
This commit is contained in:
parent
8310befc76
commit
3c8569814c
3 changed files with 2 additions and 13 deletions
|
@ -14,7 +14,6 @@ dependencies = [
|
|||
"scrapy>=2.10.0",
|
||||
"feedparser>=6.0.10",
|
||||
"uvloop>=0.17.0",
|
||||
"rocketry>=2.5.1",
|
||||
"fastapi>=0.101.0",
|
||||
"uvicorn>=0.22.0",
|
||||
]
|
||||
|
|
|
@ -12,7 +12,6 @@ from .controller import import_scrapers
|
|||
from .controller import run_all
|
||||
|
||||
app_fastapi = None
|
||||
app_rocketry = None
|
||||
|
||||
|
||||
class SnowScraper(uvicorn.Server):
|
||||
|
@ -25,16 +24,13 @@ async def start_server() -> None:
|
|||
print("Starting SnowScraper")
|
||||
server = SnowScraper(config=uvicorn.Config(app_fastapi, workers=1, loop="uvloop"))
|
||||
fastapi = asyncio.create_task(server.serve())
|
||||
rocket = asyncio.create_task(app_rocketry.serve())
|
||||
app_rocketry.task
|
||||
|
||||
await asyncio.wait([rocket, fastapi], return_when=asyncio.FIRST_COMPLETED)
|
||||
await asyncio.wait([fastapi], return_when=asyncio.FIRST_COMPLETED)
|
||||
|
||||
|
||||
def main(args: argparse.Namespace) -> None:
|
||||
global app_fastapi, app_rocketry
|
||||
global app_fastapi
|
||||
|
||||
from .scheduler import app as app_rocketry
|
||||
from .webserver import app as app_fastapi
|
||||
|
||||
import_scrapers()
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
from rocketry import Rocketry
|
||||
|
||||
app = Rocketry(execution="async")
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
Loading…
Reference in a new issue