Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more logs #54

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions discord_analyzer/rn_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def recompute_analytics(self, guildId):
---------
`None`
"""
logging.info(f"GUILDID: {guildId} | recompute_analytics")

client = self.DB_connections.mongoOps.mongo_db_access.db_mongo_client

Expand Down
8 changes: 8 additions & 0 deletions discord_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ def analyzer_recompute(sagaId: str, rabbit_creds: dict[str, Any]):
platform_id = saga.data["platformId"]
guildId, commnity_id = get_guild_community_ids(platform_id)

logging.info("Initializing the analyzer")
analyzer_init = AnalyzerInit(commnity_id)
analyzer, mongo_creds = analyzer_init.get_analyzer()
logging.info("Analyzer initialized")

def recompute_wrapper(**kwargs):
logging.info("recompute wrapper")
analyzer.recompute_analytics(guildId=guildId)

def publish_wrapper(**kwargs):
pass

logging.info("Calling the saga.next()")
saga.next(
publish_method=publish_wrapper,
call_function=recompute_wrapper,
Expand All @@ -62,15 +66,19 @@ def analyzer_run_once(sagaId: str, rabbit_creds: dict[str, Any]):
platform_id = saga.data["platformId"]
guildId, commnity_id = get_guild_community_ids(platform_id)

logging.info("Initializing the analyzer")
analyzer_init = AnalyzerInit(commnity_id)
analyzer, mongo_creds = analyzer_init.get_analyzer()
logging.info("Analyzer initialized")

def run_once_wrapper(**kwargs):
logging.info("run_once wrapper")
analyzer.run_once(guildId=guildId)

def publish_wrapper(**kwargs):
pass

logging.info("Calling the saga.next()")
saga.next(
publish_method=publish_wrapper,
call_function=run_once_wrapper,
Expand Down