summaryrefslogtreecommitdiff
path: root/workers.go
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-07-19 11:45:02 +0100
committerKatolaZ <katolaz@freaknet.org>2017-07-19 11:45:02 +0100
commit95955f17a38e7f517d4613c004e66d8232073f79 (patch)
tree0a1b5ce81e3d449475ff70149033f8d2450434ce /workers.go
parent40c8aae58491b07adb05d348d1ddf86ce5ec2be8 (diff)
tag checking and validation complete.
Diffstat (limited to 'workers.go')
-rw-r--r--workers.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/workers.go b/workers.go
index c48c65f..b92d3cb 100644
--- a/workers.go
+++ b/workers.go
@@ -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)