From c72f4ba475f59295f1bbf5a38ef9e5bb9b659402 Mon Sep 17 00:00:00 2001 From: Richard Patel Date: Sat, 9 Feb 2019 16:50:45 +0100 Subject: [PATCH] Fix segfault --- scheduler.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scheduler.go b/scheduler.go index a87bb27..9febcd5 100644 --- a/scheduler.go +++ b/scheduler.go @@ -22,17 +22,16 @@ func Schedule(c context.Context, remotes <-chan *OD) { go Stats(c) for remote := range remotes { + // Create HTTP client + remote.WCtx.OD = remote + remote.WCtx.Prepare() + logrus.WithField("url", remote.BaseUri.String()). Info("Starting crawler") - // Create HTTP client - remote.WCtx.Prepare() - // Collect results results := make(chan File) - remote.WCtx.OD = remote - // Get queue path queuePath := path.Join("queue", fmt.Sprintf("%d", remote.Task.WebsiteId))