Remove Rocketry

This commit is contained in:
hackish 2023-08-28 18:18:29 -07:00
parent 8310befc76
commit 3c8569814c
3 changed files with 2 additions and 13 deletions

View file

@ -14,7 +14,6 @@ dependencies = [
"scrapy>=2.10.0", "scrapy>=2.10.0",
"feedparser>=6.0.10", "feedparser>=6.0.10",
"uvloop>=0.17.0", "uvloop>=0.17.0",
"rocketry>=2.5.1",
"fastapi>=0.101.0", "fastapi>=0.101.0",
"uvicorn>=0.22.0", "uvicorn>=0.22.0",
] ]

View file

@ -12,7 +12,6 @@ from .controller import import_scrapers
from .controller import run_all from .controller import run_all
app_fastapi = None app_fastapi = None
app_rocketry = None
class SnowScraper(uvicorn.Server): class SnowScraper(uvicorn.Server):
@ -25,16 +24,13 @@ async def start_server() -> None:
print("Starting SnowScraper") print("Starting SnowScraper")
server = SnowScraper(config=uvicorn.Config(app_fastapi, workers=1, loop="uvloop")) server = SnowScraper(config=uvicorn.Config(app_fastapi, workers=1, loop="uvloop"))
fastapi = asyncio.create_task(server.serve()) 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: 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 from .webserver import app as app_fastapi
import_scrapers() import_scrapers()

View file

@ -1,6 +0,0 @@
from rocketry import Rocketry
app = Rocketry(execution="async")
if __name__ == "__main__":
app.run()