summaryrefslogtreecommitdiff
path: root/workers.go
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-08-07 09:55:35 +0100
committerKatolaZ <katolaz@freaknet.org>2017-08-07 09:55:35 +0100
commit096b3fd2867d7bb2d3cd1f85d8806c651b26d625 (patch)
tree4dfcc77e86cc0e667c14a92c43d1785b4cb5e4b8 /workers.go
parent802d703f617036ec1d18aa8ecb9678ca3390f68a (diff)
parentd3105e671a19fec1060652531ce783227fb9fab6 (diff)
Merge branch 'devel'
Diffstat (limited to 'workers.go')
-rw-r--r--workers.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/workers.go b/workers.go
index 84bd670..1d67770 100644
--- a/workers.go
+++ b/workers.go
@@ -13,7 +13,7 @@ import (
// Matches returns true if the configured repo:branch of the worker
// matches the repo and branch provided as arguments
-func (w *SCORSHworker) Matches(repo, branch string) bool {
+func (w *worker) Matches(repo, branch string) bool {
for _, r := range w.Repos {
parts := strings.SplitN(r, ":", 2)
@@ -32,7 +32,7 @@ func (w *SCORSHworker) Matches(repo, branch string) bool {
// LoadKeyrings loads the configured keyrings for all the commands
// managed by the worker
-func (w *SCORSHworker) LoadKeyrings() error {
+func (w *worker) LoadKeyrings() error {
w.Keys = make(map[string]openpgp.KeyRing)
w.TagKeys = make(map[string]map[string]bool)
@@ -72,7 +72,7 @@ func (w *SCORSHworker) LoadKeyrings() error {
}
// LoadTags loads all the configured commands for the worker
-func (w *SCORSHworker) LoadTags() error {
+func (w *worker) LoadTags() error {
wTags, err := ioutil.ReadFile(w.Tagfile)
if err != nil {
@@ -90,9 +90,9 @@ func (w *SCORSHworker) LoadTags() error {
}
//
-func runWorker(w *SCORSHworker) {
+func runWorker(w *worker) {
- var msg SCORSHmsg
+ var msg spoolMsg
log.Printf("[worker: %s] Started\n", w.Name)
@@ -116,8 +116,8 @@ func runWorker(w *SCORSHworker) {
}
// StartWorkers starts all the workers specified in a given
-// configuration and fills in the SCORSHmaster struct
-func startWorkers(master *SCORSHmaster) error {
+// configuration and fills in the master struct
+func startWorkers(master *master) error {
numWorkers := len(master.Workers)
@@ -130,7 +130,7 @@ func startWorkers(master *SCORSHmaster) error {
worker := &(master.Workers[w])
// Set the Status and Msg channels
worker.StatusChan = master.StatusChan
- worker.MsgChan = make(chan SCORSHmsg, 10)
+ worker.MsgChan = make(chan spoolMsg, 10)
// Load worker tags from worker.Tagfile
err := worker.LoadTags()