Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
4ed63205
Commit
4ed63205
authored
Jul 14, 2017
by
Erick Hitter
Browse files
Don't run events we know we can't
Just a waste of resources, and next go around will capture these.
parent
23685173
Changes
1
Hide whitespace changes
Inline
Side-by-side
runner/runner.go
View file @
4ed63205
...
...
@@ -274,6 +274,14 @@ func getSiteEvents(site string) ([]Event, error) {
func
runEvents
(
workerId
int
,
events
<-
chan
Event
)
{
for
event
:=
range
events
{
if
now
:=
time
.
Now
();
event
.
Timestamp
>
int
(
now
.
Unix
())
{
if
debug
{
logger
.
Printf
(
"runEvents-%d skipping premature job %d|%s|%s for %s"
,
workerId
,
event
.
Timestamp
,
event
.
Action
,
event
.
Instance
,
event
.
Url
)
}
continue
}
subcommand
:=
[]
string
{
"cron-control"
,
"orchestrate"
,
"runner-only"
,
"run"
,
fmt
.
Sprintf
(
"--timestamp=%d"
,
event
.
Timestamp
),
fmt
.
Sprintf
(
"--action=%s"
,
event
.
Action
),
fmt
.
Sprintf
(
"--instance=%s"
,
event
.
Instance
),
fmt
.
Sprintf
(
"--url=%s"
,
event
.
Url
)}
runWpCliCmd
(
subcommand
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment