Re-poll doFetchFeaturedUris every so often #1090

Closed
daovist wants to merge 1 commit from repoll-featured-uris into master
daovist commented 2018-03-12 17:06:45 +01:00 (Migrated from github.com)

issue #1048

I copied the way doBalanceSubscribe and doUpdateBalance work together in the form of doFetchFeaturedUris and doFetchFeaturedUrisNow. Every 40 seconds (will be 1 hour once it works properly) this calls the action and fetches the correct data, but if you leave the Discover page and come back, it starts a new loop of calling the action every 40 seconds. I've a tried a few ways of naming the setInterval so I can clearInterval but haven't got it working properly yet. I can think of how I'd do it with new state properties and reducers but am trying to avoid that.

I am digging deeper into this and submitting the PR to discuss the code

issue #1048 I copied the way `doBalanceSubscribe` and `doUpdateBalance` work together in the form of `doFetchFeaturedUris` and `doFetchFeaturedUrisNow`. Every 40 seconds (will be 1 hour once it works properly) this calls the action and fetches the correct data, but if you leave the Discover page and come back, it starts a new loop of calling the action every 40 seconds. I've a tried a few ways of naming the setInterval so I can clearInterval but haven't got it working properly yet. I can think of how I'd do it with new state properties and reducers but am trying to avoid that. I am digging deeper into this and submitting the PR to discuss the code
liamcardenas (Migrated from github.com) requested changes 2018-03-27 04:19:07 +02:00
@ -82,0 +76,4 @@
}
}
export function doFetchFeaturedUrisNow() {
liamcardenas (Migrated from github.com) commented 2018-03-27 04:18:59 +02:00

Setting an interval like this is absolutely correct, but it would be better if you found the place that originally triggers doFetchFeaturedUris and set the interval there instead of creating two actions.

Setting an interval like this is absolutely correct, but it would be better if you found the place that originally triggers `doFetchFeaturedUris` and set the interval there instead of creating two actions.
neb-b commented 2018-05-11 08:01:17 +02:00 (Migrated from github.com)

@daovist It would be great to get this in. I agree with Liam's comments, you should be able to move the setInterval to wherever the doFetchFeaturedUris is originally called

@daovist It would be great to get this in. I agree with Liam's comments, you should be able to move the `setInterval` to wherever the `doFetchFeaturedUris` is originally called
tzarebczan commented 2018-06-14 21:30:35 +02:00 (Migrated from github.com)

@daovist do you plan on picking this back up?

@daovist do you plan on picking this back up?

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#1090
No description provided.