-
Notifications
You must be signed in to change notification settings - Fork 2.8k
add event triggers #329
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
add event triggers #329
Conversation
Review app available at: https://hge-ci-pull-329.herokuapp.com |
1 similar comment
Review app available at: https://hge-ci-pull-329.herokuapp.com |
server/src-exec/Main.hs
Outdated
res <- runTx ci unlockAllEvents | ||
either ((>> exitFailure) . printJSON) return res | ||
getMaxEventThreads = do | ||
mEnv <- lookupEnv "HASURA_GRAPHQL_EVENTS_HTTP_POOL_SIZE" |
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.
can be abstracted out in a function:
getFromEnv :: (Read a) => String -> IO a
server/src-lib/Hasura/Events/HTTP.hs
Outdated
|
||
data HTTPSessionMgr | ||
= HTTPSessionMgr | ||
{ _hsmSession :: !WS.Session |
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.
Get rid of this type. Just use WS.Session. Let's not support insecure connections to webhooks.
server/src-lib/Hasura/Events/HTTP.hs
Outdated
retryPol' = R.RetryPolicyM $ liftIO . R.getRetryPolicyM (_hRetryPolicy http) | ||
retryFn' _ = return . _hRetryFn http | ||
|
||
runInsecureHTTP |
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.
This function is not needed
server/src-lib/Hasura/Events/HTTP.hs
Outdated
|
||
httpWithLogging | ||
:: (MonadReader r m, MonadIO m, Has HTTPSessionMgr r, Has HLogger r) | ||
=> W.Options -> Bool -> HTTP a -> Maybe ExtraContext -> R.RetryStatus -> m (Either HTTPErr a) |
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.
remove the isSecure
argument
server/src-lib/Hasura/Events/HTTP.hs
Outdated
& W.checkResponse .~ Just ignoreStatusCodeExceptions | ||
|
||
-- the actual function which makes the relevant Wreq calls | ||
finallyRunHTTPPlz sessMgr = |
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.
Plz
?
server/src-rsr/trigger.sql
Outdated
@@ -0,0 +1,26 @@ | |||
CREATE OR REPLACE function hdb_views.notify_hasura_{{NAME}}_{{OPERATION}}() RETURNS trigger |
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.
.sql.j2
extension
\ _sql text; \ | ||
\ BEGIN \ | ||
\ SELECT INTO _sql \ | ||
\ string_agg(format('DROP FUNCTION %s(%s) CASCADE;' \ |
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'll have to use quote_ident
for identifiers.
Review app available at: https://hge-ci-pull-329.herokuapp.com |
Review app available at: https://hge-ci-pull-329.herokuapp.com |
Review app available at: https://hge-ci-pull-329.herokuapp.com |
1 similar comment
Review app available at: https://hge-ci-pull-329.herokuapp.com |
Review app available at: https://hge-ci-pull-329.herokuapp.com |
1 similar comment
Review app available at: https://hge-ci-pull-329.herokuapp.com |
Review app https://hge-ci-pull-329.herokuapp.com is deleted |
GitOrigin-RevId: 4efe84b7c0ed6229392b752632c8f7034a718a2d
Co-authored-by: Paritosh <paritosh@hasura.io> V3_GIT_ORIGIN_REV_ID: d41a19cb58afb69843d7450d884d1e69b585fcfa
No description provided.