lbry-desktop/flow-typed/livestream.js
infinite-persistence a7cf89a977 Limit livestream fetches when failed
We were already limiting the call to once-per-5-minutes (for the succesful case), so just need to put failure cases into the mix.

Retry 3 times before stopping.
2022-05-04 08:44:33 -04:00

44 lines
1.1 KiB
JavaScript

// @flow
declare type LivestreamReplayItem = {
data: {
claimId: string,
deleted: boolean,
deletedAt: ?string,
ffprobe: any,
fileDuration: number, // decimal? float? string?
fileType: string,
fileLocation: string,
fileSize: number,
key: string,
published: boolean,
publishedAt: ?string,
service: string,
thumbnails: Array<string>,
uploadedAt: string, // Date?
},
id: string,
};
declare type LivestreamReplayData = Array<LivestreamReplayItem>;
declare type LivestreamState = {
fetchingById: {},
viewersById: {},
fetchingActiveLivestreams: boolean | string,
activeLivestreams: ?LivestreamInfo,
activeLivestreamsLastFetchedDate: number,
activeLivestreamsLastFetchedOptions: {},
activeLivestreamsLastFetchedFailCount: number,
activeLivestreamInitialized: boolean,
socketConnectionById: { [id: string]: { connected: ?boolean, sub_category: ?string } },
};
declare type LivestreamInfo = {
[/* creatorId */ string]: {
live: boolean,
viewCount: number,
creatorId: string,
claimId: string,
claimUri: string,
},
};