-
Notifications
You must be signed in to change notification settings - Fork 2.8k
refactor event processing logic #1639
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
Conversation
37e2a2f to
6a50324
Compare
6a50324 to
cab75bd
Compare
|
Review app for commit cab75bd deployed to Heroku: https://hge-ci-pull-1639.herokuapp.com |
server/src-lib/Hasura/Events/Lib.hs
Outdated
| let EventEngineCtx _ c _ _ = eeCtx | ||
| modifyTVar' c (\v -> v - 1) | ||
|
|
||
| case eitherResp of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a one liner for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use onLeft from GraphQL.Utils. Also please move onNothing, onJust, onLeft from GraphQL.Utils to Hasura.Prelude
2a221f3 to
ad4ddd7
Compare
0x777
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More generally
- Remove type annotations where not needed
- Keep the line limit to 80-90 chars
server/src-lib/Hasura/Events/Lib.hs
Outdated
| res <- tryWebhook logenv pool e | ||
| finally <- either errorFn successFn res | ||
| liftIO $ either (logQErr logger) (void.return) finally | ||
| cacheRef::CacheRef <- asks getter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need these type annotations
server/src-lib/Hasura/Events/Lib.hs
Outdated
|
|
||
| logQErr :: ( MonadReader r m, MonadIO m, Has HLogger r) => QErr -> m () | ||
| logQErr err = do | ||
| (logger:: HLogger) <- asks getter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same. You don't need these annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some other context, these variables were not resolving to correct type without annotation. But they seem to be fine now.
server/src-lib/Hasura/Events/Lib.hs
Outdated
| let EventEngineCtx _ c _ _ = eeCtx | ||
| modifyTVar' c (\v -> v - 1) | ||
|
|
||
| case eitherResp of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use onLeft from GraphQL.Utils. Also please move onNothing, onJust, onLeft from GraphQL.Utils to Hasura.Prelude
071e5dd to
0de175c
Compare
|
Review app for commit 5129728 deployed to Heroku: https://hge-ci-pull-1639.herokuapp.com |
|
Review app https://hge-ci-pull-1639.herokuapp.com is deleted |
No-op code refactor/cleanup
Description
What component does this PR affect?
Requires changes from other components? If yes, please mark the components:
Related Issue
Solution and Design
Type
Checklist: