Skip to content
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

retry for join and start #244

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions web/src/components/HomePage/PvpView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ const PvpView = ({ atBats, tokens }: { atBats: AtBat[]; tokens: OwnedToken[] })
router.push(`atbats/?id=${atBatId}`);
}
},
retryDelay: (attemptIndex) => (attemptIndex < 1 ? 5000 : 10000),
retry: (failureCount, error) => {
console.log(error);
if (failureCount < 3) {
console.log("Will retry in 5, maybe 10 seconds");
}
return failureCount < 3;
},
onError: (e: Error) => {
toast("Join failed" + e?.message, "error");
},
Expand Down
8 changes: 8 additions & 0 deletions web/src/components/campaign/CharacterCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ const CharacterCard = ({
router.push(`atbats/?id=${atBatId}`);
}
},
retryDelay: (attemptIndex) => (attemptIndex < 1 ? 5000 : 10000),
retry: (failureCount, error) => {
console.log(error);
if (failureCount < 3) {
console.log("Will retry in 5, maybe 10 seconds");
}
return failureCount < 3;
},
onError: (e: Error) => {
toast("Join failed" + e?.message, "error");
},
Expand Down
8 changes: 8 additions & 0 deletions web/src/components/practice/PracticeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ const PracticeSelect = () => {
router.push(`atbats/?id=${atBatId}`);
}
},
retryDelay: (attemptIndex) => (attemptIndex < 1 ? 5000 : 10000),
retry: (failureCount, error) => {
console.log(error);
if (failureCount < 3) {
console.log("Will retry in 5, maybe 10 seconds");
}
return failureCount < 3;
},
onError: (e: Error) => {
toast("Join failed" + e?.message, "error");
},
Expand Down
8 changes: 8 additions & 0 deletions web/src/components/tokens/PlayButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ const PlayButtons = ({ token }: { token: OwnedToken }) => {
});
router.push(`atbats/?session_id=${data.sessionID}`);
},
retryDelay: (attemptIndex) => (attemptIndex < 1 ? 5000 : 10000),
retry: (failureCount, error) => {
console.log(error);
if (failureCount < 3) {
console.log("Will retry in 5, maybe 10 seconds");
}
return failureCount < 3;
},
onError: (e: Error) => {
toast("Start failed: " + e?.message, "error");
},
Expand Down
Loading