Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Bulk Provide/Reproviding System #34

Merged
merged 29 commits into from
May 14, 2021
Merged

Bulk Provide/Reproviding System #34

merged 29 commits into from
May 14, 2021

Conversation

aschmahmann
Copy link
Contributor

Add an alternative provide/reproviding system that:

  • keeps track of when reproviding was done so we don't just do it whenever we start up the provider system if we're given a datastore with persistence
  • requires an interface that deals with providing many objects at once rather than just one at a time
  • emits some basic stats around how much providing has been done

@aschmahmann aschmahmann force-pushed the feat/bulk-provide branch 2 times, most recently from f9f54af to 5a4e4c4 Compare April 9, 2021 15:40
…racking of individual CID reprovide times, and have a very simple and fast stats function
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
queue/queue.go Outdated Show resolved Hide resolved
queue/queue.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go timers are... special.

batched/system.go Outdated Show resolved Hide resolved
batched/system.go Show resolved Hide resolved
batched/system.go Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
@aschmahmann aschmahmann marked this pull request as ready for review May 12, 2021 20:10
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Show resolved Hide resolved
batched/system.go Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved
batched/system.go Outdated Show resolved Hide resolved

func resetTimer(t *time.Timer, dur time.Duration) {
if !t.Stop() {
<-t.C
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will block forever if the timer wasn't already running.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More tests would be nice, but otherwise LGTM (module one small change).

batched/system.go Outdated Show resolved Hide resolved
@aschmahmann aschmahmann merged commit d391dae into master May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants