Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
service-prober
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai3
tools
service-prober
Commits
77aad2c0
Commit
77aad2c0
authored
3 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Forgot a 10^9 multiplier when computing initial offset of periodic tasks
parent
4e5224f5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scheduler/scheduler.go
+1
-1
1 addition, 1 deletion
scheduler/scheduler.go
with
1 addition
and
1 deletion
scheduler/scheduler.go
+
1
−
1
View file @
77aad2c0
...
...
@@ -23,7 +23,7 @@ func New() *Scheduler {
func
(
s
*
Scheduler
)
Add
(
event
PeriodicEvent
)
{
// Schedule the task at some random point in the future during its
// first interval, so that all tasks are scattered equally.
intervalFrac
:=
time
.
Duration
(
event
.
Interval
()
.
Seconds
()
*
rand
.
Float64
())
intervalFrac
:=
time
.
Duration
(
event
.
Interval
()
.
Seconds
()
*
rand
.
Float64
())
*
time
.
Second
when
:=
time
.
Now
()
.
Add
(
intervalFrac
)
s
.
scheduleCh
<-
&
timerData
{
event
:
event
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment