Skip to content

Commit

Permalink
Merge pull request #54 from TogetherCrew/update-selected-channels-rea…
Browse files Browse the repository at this point in the history
…ding

Add more logs
  • Loading branch information
amindadgar authored Dec 12, 2023
2 parents 0dfb336 + c1c7e6d commit ee27a63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit ee27a63

Please sign in to comment.