scramjetorg / platform-samples

Scramjet Cloud Platform Sequence Samples
MIT License
8 stars 0 forks source link

Slack addon, three different lead states #79

Closed gzukowski closed 1 year ago

S4adam commented 1 year ago

This line seems to be a leftover.

In Auth0, you check if an error occured with the string condition but a better way would be to check its status_code, like: if verified.status_code != 200: ..., and then parse it as json().

The get_auth() is async so I think these:

            verified = requests.get(self.verified_url, headers=headers).json()
            users = requests.get(self.users_url, headers=headers).json()

requests could be made asynchronously.

Instead of using prints, I think we should stick to the context.logger. Then you could specify log levels explicitly, so in except blocks you would use context.logger.error("..."), and for informational messages context.logger.info("...") etc.

Little inconsistency - in Auth0, asyncio.gather() is inside the try-except block, but in Stripe it is not.

And of course, as @MichalCz stated, constant variables should be introduced!:D

gzukowski commented 1 year ago

@S4adam you were right ,"tako" is a debug leftover and I accidentally corrected it but in other file