-
-
Save 2colours/255b578e65003f5c85b04ec21cd70bf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub web-retrial(&actions, :$log-message) { | |
loop { | |
CATCH { | |
when X::Cro::HTTP::Error | X::Cro::HTTP::Client::Timeout { | |
say $log-message; | |
next; | |
} | |
} | |
return actions; | |
} | |
} | |
sub fetch-execution($execution-id) is cached { | |
web-retrial :log-message("$execution-id is being refetched..."), { | |
my $response = await $*client.get("https://some-jira-endpoint", | |
query => { | |
fields => 'some jira fields' | |
}, | |
:$*auth, | |
:20timeout | |
); | |
await $response.body; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment