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

fixing everything #123

Merged
merged 3 commits into from
Jul 14, 2023
Merged

fixing everything #123

merged 3 commits into from
Jul 14, 2023

Conversation

wbaccinelli
Copy link
Contributor

@wbaccinelli wbaccinelli requested a review from raar1 July 14, 2023 09:13
Copy link
Contributor

@raar1 raar1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, nice. So, am I understanding correctly that you have moved the message sending code (that used to be in Rasa) to a celery task, so it's now fully async? The delay issue is no longer noticeable?

@@ -395,11 +393,38 @@ def resume_and_trigger(self, # pylint: disable=unused-argument
if response_resume.status_code != 200:
raise Exception()

response_intent = send_trigger(user_id, trigger)
if response_intent != 200:
print('Exception, retrying')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we log this instead of printing it, or is that not appropriate here? Also I would make the message slightly more descriptive - maybe "Exception during resume_and_trigger" or something, to at least say which function it was happening it (same for the others).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely yes, I will do this.

recipient_id = mes['recipient_id']
message = mes['text']
client.post_message(int(recipient_id), message)
if ENVIRONMENT == 'prod':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no delays simulated in testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, maybe I'd better keep it always active indeed.

scheduler/celery_tasks.py Outdated Show resolved Hide resolved
@wbaccinelli
Copy link
Contributor Author

OK, nice. So, am I understanding correctly that you have moved the message sending code (that used to be in Rasa) to a celery task, so it's now fully async? The delay issue is no longer noticeable?

@raar1 Exactly, and it runs so smoothly now that I could cry.

wbaccinelli and others added 2 commits July 14, 2023 16:39
Co-authored-by: Robin Richardson <raar1@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 14, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@wbaccinelli wbaccinelli merged commit fd18cfe into main Jul 14, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot handle multiple users when using custom channel
2 participants