Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 134
PROTO-1335: relay upload delay#6281
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
19867be1069ccc1795a737553e90995a8f063501758e52c4aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -30,7 +30,8 @@ import { | ||
| fork, | ||
| cancel, | ||
| all, | ||
| getContext | ||
| getContext, | ||
| delay | ||
| } from 'redux-saga/effects' | ||
| import { make } from 'common/store/analytics/actions' | ||
| @@ -796,6 +797,7 @@ function* uploadCollection(tracks, userId, collectionMetadata, isAlbum) { | ||
| `Could not confirm playlist creation for playlist id ${playlistId}` | ||
| ) | ||
| } | ||
| return (yield call(audiusBackendInstance.getPlaylists, userId, [ | ||
| playlistId | ||
| ]))[0] | ||
| @@ -1010,14 +1012,25 @@ function* uploadSingleTrack(track) { | ||
| throw new Error(`Could not confirm upload single track ${trackId}`) | ||
| } | ||
| return yield apiClient.getTrack({ | ||
| id: trackId, | ||
| currentUserId: userId, | ||
| unlistedArgs: { | ||
| urlTitle: formatUrlName(track.metadata.title), | ||
| handle | ||
| let retries = 30 | ||
| while (retries !== 0) { | ||
| const maybeTrackRes = yield apiClient.getTrack({ | ||
| id: trackId, | ||
| currentUserId: userId, | ||
| unlistedArgs: { | ||
| urlTitle: formatUrlName(track.metadata.title), | ||
| handle | ||
| } | ||
| }) | ||
| if (maybeTrackRes !== undefined && maybeTrackRes !== null) { | ||
| return maybeTrackRes | ||
| } | ||
| }) | ||
| // lil bit of delay for retries | ||
| yield delay(1500) | ||
Comment on lines
1028
to
1029
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use a variable delay to disperse groups of failed calls? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. like add a back off of some kind? Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah... I'm not sure if it's necessary though. Concurrent upload volume shouldn't be high enough to stress anything on a 1.5s interval. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't think so. This is also a Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ya let's leave as is. Ty for entertaining my thinking out loud lol | ||
| retries -= 1 | ||
| } | ||
| throw new Error(`Exhausted retries querying for track ${trackId}`) | ||
| }, | ||
| function* onSuccess(confirmedTrack) { | ||
| yield call(responseChan.put, { confirmedTrack }) | ||
| @@ -1087,6 +1100,7 @@ function* uploadSingleTrack(track) { | ||
| status: ProgressStatus.COMPLETE | ||
| }) | ||
| ) | ||
| yield put( | ||
| uploadActions.uploadTracksSucceeded(confirmedTrack.track_id, [ | ||
| confirmedTrack | ||
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 is all post confirmation, right? so we're not depending on upload or confirmation time to fit within the retry window.
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.
no, the upload has already succeeded, this is purely for indexing
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.
brilliant. Sounds good to me!