diff options
author | KatolaZ <katolaz@freaknet.org> | 2017-07-19 11:45:02 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2017-07-19 11:45:02 +0100 |
commit | 95955f17a38e7f517d4613c004e66d8232073f79 (patch) | |
tree | 0a1b5ce81e3d449475ff70149033f8d2450434ce /workers.go | |
parent | 40c8aae58491b07adb05d348d1ddf86ce5ec2be8 (diff) |
tag checking and validation complete.
Diffstat (limited to 'workers.go')
-rw-r--r-- | workers.go | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -9,7 +9,6 @@ import ( "os" "regexp" "strings" - "time" ) func (worker *SCORSHworker) Matches(repo, branch string) bool { @@ -96,9 +95,6 @@ func Worker(w *SCORSHworker) { if err != nil { log.Printf("[worker: %s] error in walk_commits: %s", err) } - debug.log("[worker: %s] Received message: %s", w.Name, msg) - debug.log("[worker: %s] StatusChan: %s\n", w.Name, w.StatusChan) - time.Sleep(1000 * time.Millisecond) w.StatusChan <- msg debug.log("[worker: %s] Sent message back: %s", w.Name, msg) } @@ -133,6 +129,16 @@ func StartWorkers(master *SCORSHmaster) error { close(worker.MsgChan) return fmt.Errorf("[Starting worker: %s] Unable to load tags: %s\n", worker.Name, err) } + + // Create the map of keyring for each tag + worker.TagKeys = make(map[string]map[string]bool) + for _, t := range worker.Tags { + worker.TagKeys[t.Name] = make(map[string]bool) + for _, k := range t.Keyrings { + worker.TagKeys[t.Name][k] = true + } + } + // Add the repos definitions to the map master.Repos for _, repo_name := range worker.Repos { master.Repos[repo_name] = append(master.Repos[repo_name], worker) |