-
Notifications
You must be signed in to change notification settings - Fork 1
Retry webhook emission if failure #49
Conversation
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.
just had some comments.
did you get a chance to test this too?
|
||
def notify_provider | ||
redis = Redis.new | ||
key = 'webhooks/provider_last_notified_at' |
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.
Should this be specific to the organization that you're retrying for? Otherwise, how would you know who was the last organization notified?
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.
@mattgmarcus this is sent to the provider (e.g. ModernTreasury). The event ID is also included in that email. It's not organization-specific, because if the webhook endpoint is down, it's likely down for all organizations.
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.
Ah got it
notify_provider | ||
|
||
event.retries ||= 0 | ||
event.retries += 1 |
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.
Do you need an event.save!
@mattgmarcus I do need to add tests for this still. |
f7d9d15
to
1997b77
Compare
@mattgmarcus After some research, it doesn't give you too much control over retries: https://github.com/mperham/sidekiq/wiki/Job-Lifecycle#altering-the-lifecycle It just allows you to set the number of retries but not the backoff. Here is the hard-coded backoff: https://github.com/mperham/sidekiq/wiki/Error-Handling#automatic-job-retry If we are OK with that, I can do the following:
Thoughts? |
I say we use the default Sidekiq retry stuff. We can customize later if we want but let's just keep it simpler. Your approach looks good. |
We can, although relatively easy to do as that codes already written so it
sends at most one in a 24 hour period.
…--
Ryan Jackson
ryanwjackson@gmail.com
On Sat, Sep 28, 2019 at 12:02 PM Matt Marcus ***@***.***> wrote:
I say we use the default Sidekiq retry stuff. We can customize later if we
want but let's just keep it simpler. Your approach looks good.
As for keeping track of the last emails you got - could we just punt on
that and track in a separate ticket? I know that could get annoying to have
a bunch of emails with scale. But we can fix this later (i.e. not needed to
ship)
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#49?email_source=notifications&email_token=AAFAT3UVNTQRW42DXFUODKDQL55Z3A5CNFSM4I26IKN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD724XYA#issuecomment-536202208>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFAT3XSWZAQCDDXV2ZOXSLQL55Z3ANCNFSM4I26IKNQ>
.
|
Fair enough. Okay let’s use sidekiq and keep the stuff to do once a day.
Sound good?
…On Sat, Sep 28, 2019 at 3:33 PM Ryan ***@***.***> wrote:
We can, although relatively easy to do as that codes already written so it
sends at most one in a 24 hour period.
--
Ryan Jackson
***@***.***
On Sat, Sep 28, 2019 at 12:02 PM Matt Marcus ***@***.***>
wrote:
> I say we use the default Sidekiq retry stuff. We can customize later if
we
> want but let's just keep it simpler. Your approach looks good.
> As for keeping track of the last emails you got - could we just punt on
> that and track in a separate ticket? I know that could get annoying to
have
> a bunch of emails with scale. But we can fix this later (i.e. not needed
to
> ship)
>
> —
> You are receiving this because you were assigned.
> Reply to this email directly, view it on GitHub
> <
#49?email_source=notifications&email_token=AAFAT3UVNTQRW42DXFUODKDQL55Z3A5CNFSM4I26IKN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD724XYA#issuecomment-536202208
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AAFAT3XSWZAQCDDXV2ZOXSLQL55Z3ANCNFSM4I26IKNQ
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49?email_source=notifications&email_token=ABEI75HTHAH3G5N3XPNPLM3QL6WSHA5CNFSM4I26IKN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73A6CA#issuecomment-536219400>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEI75AZZX5PKTGCRFETQXLQL6WSHANCNFSM4I26IKNQ>
.
|
Yup. Give me a few and will sub it for a review.
On Sat, Sep 28, 2019 at 15:34 Matt Marcus ***@***.***> wrote:
Fair enough. Okay let’s use sidekiq and keep the stuff to do once a day.
Sound good?
On Sat, Sep 28, 2019 at 3:33 PM Ryan ***@***.***> wrote:
> We can, although relatively easy to do as that codes already written so
it
> sends at most one in a 24 hour period.
>
>
> --
> Ryan Jackson
> ***@***.***
>
>
> On Sat, Sep 28, 2019 at 12:02 PM Matt Marcus ***@***.***>
> wrote:
>
> > I say we use the default Sidekiq retry stuff. We can customize later if
> we
> > want but let's just keep it simpler. Your approach looks good.
> > As for keeping track of the last emails you got - could we just punt on
> > that and track in a separate ticket? I know that could get annoying to
> have
> > a bunch of emails with scale. But we can fix this later (i.e. not
needed
> to
> > ship)
> >
> > —
> > You are receiving this because you were assigned.
> > Reply to this email directly, view it on GitHub
> > <
>
#49?email_source=notifications&email_token=AAFAT3UVNTQRW42DXFUODKDQL55Z3A5CNFSM4I26IKN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD724XYA#issuecomment-536202208
> >,
> > or mute the thread
> > <
>
https://github.com/notifications/unsubscribe-auth/AAFAT3XSWZAQCDDXV2ZOXSLQL55Z3ANCNFSM4I26IKNQ
> >
> > .
> >
>
> —
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <
#49?email_source=notifications&email_token=ABEI75HTHAH3G5N3XPNPLM3QL6WSHA5CNFSM4I26IKN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73A6CA#issuecomment-536219400
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/ABEI75AZZX5PKTGCRFETQXLQL6WSHANCNFSM4I26IKNQ
>
> .
>
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#49?email_source=notifications&email_token=AAFAT3QIIG5UPVIJQ56XMMLQL6WVRA5CNFSM4I26IKN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73A6SI#issuecomment-536219465>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFAT3XBG6DIYQ43H2UEKTLQL6WVRANCNFSM4I26IKNQ>
.
--
…--
Ryan Jackson
ryanwjackson@gmail.com
|
1997b77
to
661e31a
Compare
@mattgmarcus Feel free to merge if you approve (and tests pass). I increased test coverage above 90%, though we have some work to do there in general. |
Fix #20