Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore the "no resource" errors for sitemap generation #168

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os/exec"
"os/signal"
"path/filepath"
"strings"
"sync/atomic"
"syscall"
"time"
Expand Down Expand Up @@ -406,7 +407,9 @@ func runWpCliCmd(subcommand []string) (string, error) {
logger.Printf("%s - %s", err, wpOutStr)
logger.Println(fmt.Sprintf("%+v", subcommand))
}

if strings.Contains(wpOutStr, "Error: No resources available to run the job with action `msm_cron_generate_sitemap_for_year_month_day`") {
return wpOutStr, nil
}
return wpOutStr, err
}

Expand Down Expand Up @@ -482,7 +485,6 @@ func waitForEpoch(whom string, epoch_sec int64) {
for i := tDelta; time.Now().UnixNano() < tNextEpoch; i += tDelta {
if i > tEpochNano*2 {
// if we ever loop here for more than 2 full epochs, bail out
logger.Printf("Error in the epoch wait loop for %s\n", whom)
break
}
if gRestart {
Expand Down