Skip to content

Commit

Permalink
Merge pull request #8 from tmichela/fixLogging1
Browse files Browse the repository at this point in the history
improve logging
  • Loading branch information
tmichela authored Aug 14, 2021
2 parents 8b2b86d + de11e3c commit c97316b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions redmine_zulip/redmine.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def track(self):
For each ticket tracked in our database, publish new messages and attachments
"""
log.info(f'tracking {len(self.issues)} issues')
Pool().map(self._track, [(n, issue) for n, issue in enumerate(reversed(self.issues))])
Pool().map(self._track, [(n, issue) for n, issue in enumerate(self.issues)])

# force reloading the list of topics to catch state changes
self.zulip_topics.cache_clear()
Expand Down Expand Up @@ -269,13 +269,16 @@ def send(self, issue, content):
if resolved_topic in self.zulip_topic_names():
topic = resolved_topic

log.info(f'sending message to: {topic}@{self.stream}')
reply = self.zulip.send_message({
"type": "stream",
"to": self.stream,
"topic": topic,
"content": content
})
log.info(reply)

if reply['result'] != 'success':
log.info(f'{reply}\ncontent:\n{content}')

@lru_cache()
def zulip_topics(self) -> List[Dict]:
Expand Down

0 comments on commit c97316b

Please sign in to comment.