Skip to content

Commit

Permalink
ClashKing v4
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Jan 29, 2024
1 parent 8b62084 commit ee8abac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions tracking/player/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@

from collections import deque
from redis import asyncio as redis
from .config import Config
from .tracking import main
from ..utils import create_keys
from tracking.player.config import Config
from tracking.player.track import main
from tracking.utils import create_keys


config = Config()
loop = asyncio.get_event_loop()
if __name__ == "__main__":
config = Config()
loop = asyncio.get_event_loop()

stats_mongo_client = motor.motor_asyncio.AsyncIOMotorClient(config.stats_mongodb)
static_mongo_client = motor.motor_asyncio.AsyncIOMotorClient(config.static_mongodb)
stats_mongo_client = motor.motor_asyncio.AsyncIOMotorClient(config.stats_mongodb)
static_mongo_client = motor.motor_asyncio.AsyncIOMotorClient(config.static_mongodb)

redis_host = redis.Redis(host=config.redis_ip, port=6379, db=0, password=config.redis_pw, decode_responses=False, max_connections=2500)
keys = create_keys([f"apiclashofclans+test{x}@gmail.com" for x in range(config.min_coc_email, config.max_coc_email + 1)], [config.coc_password] * config.max_coc_email)
keys = deque(keys)
loop.create_task(main(keys=keys, cache=redis_host, stats_mongo_client=stats_mongo_client, static_mongo_client=static_mongo_client, config=config))
loop.run_forever()
redis_host = redis.Redis(host=config.redis_ip, port=6379, db=0, password=config.redis_pw, decode_responses=False, max_connections=2500)
keys = create_keys([f"apiclashofclans+test{x}@gmail.com" for x in range(config.min_coc_email, config.max_coc_email + 1)], [config.coc_password] * config.max_coc_email)
keys = deque(keys)
loop.create_task(main(keys=keys, cache=redis_host, stats_mongo_client=stats_mongo_client, static_mongo_client=static_mongo_client, config=config))
loop.run_forever()
2 changes: 1 addition & 1 deletion tracking/player/tracking.py → tracking/player/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from msgspec.msgpack import decode
from loguru import logger
from .utils import Player, get_player_changes, gen_legend_date, gen_season_date, gen_raid_date, gen_games_season
from tracking.player.utils import Player, get_player_changes, gen_legend_date, gen_season_date, gen_raid_date, gen_games_season

from pymongo import InsertOne, UpdateOne

Expand Down

0 comments on commit ee8abac

Please sign in to comment.