Skip to content

Commit

Permalink
fix: dramatiq
Browse files Browse the repository at this point in the history
  • Loading branch information
z0z0r4 committed Jan 1, 2025
1 parent a068d8d commit c9d8712
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions app/sync/curseforge.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

from app.sync import sync_mongo_engine as mongodb_engine
from app.sync import sync_redis_engine as redis_engine
from app.sync import (
CURSEFORGE_LIMITER,
)
# from app.sync import (
# CURSEFORGE_LIMITER,
# )
from app.models.database.curseforge import File, Mod, Pagination, Fingerprint
from app.models.database.file_cdn import File as FileCDN
from app.utils.network import request_sync
Expand Down Expand Up @@ -47,12 +47,12 @@ def submit_models(models: List[Union[File, Mod, Fingerprint]]):


# limit decorator
def limit(func):
def wrapper(*args, **kwargs):
with CURSEFORGE_LIMITER.acquire():
return func(*args, **kwargs)
# def limit(func):
# def wrapper(*args, **kwargs):
# with CURSEFORGE_LIMITER.acquire():
# return func(*args, **kwargs)

return wrapper
# return wrapper


# @actor(
Expand Down
16 changes: 8 additions & 8 deletions app/sync/modrinth.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

from app.sync import sync_mongo_engine as mongodb_engine
from app.sync import sync_redis_engine as redis_engine
from app.sync import (
MODRINTH_LIMITER,
)
# from app.sync import (
# MODRINTH_LIMITER,
# )
from app.models.database.modrinth import Project, File, Version
from app.models.database.file_cdn import File as FileCDN
from app.utils.network import request_sync, request
Expand Down Expand Up @@ -58,11 +58,11 @@ def submit_models(models: List[Union[Project, File, Version]]):


# limit decorator
def limit(func):
def wrapper(*args, **kwargs):
with MODRINTH_LIMITER.acquire():
return func(*args, **kwargs)
return wrapper
# def limit(func):
# def wrapper(*args, **kwargs):
# with MODRINTH_LIMITER.acquire():
# return func(*args, **kwargs)
# return wrapper


# @actor(
Expand Down

0 comments on commit c9d8712

Please sign in to comment.