Mercurial > gemma
comparison pkg/imports/queue.go @ 2168:b868cb653c4d
Import queue: The job kind parameter when creating a new job from a string was never used.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 08 Feb 2019 15:39:17 +0100 |
parents | 59055c8301df |
children | 7c83b5277c1c |
comparison
equal
deleted
inserted
replaced
2167:40f26fbc505f | 2168:b868cb653c4d |
---|---|
71 // in pure meta-data form to the database. | 71 // in pure meta-data form to the database. |
72 JobCreator interface { | 72 JobCreator interface { |
73 // Description is the long name of the import. | 73 // Description is the long name of the import. |
74 Description() string | 74 Description() string |
75 // Create build the actual job. | 75 // Create build the actual job. |
76 // kind is the name of the import type. | |
77 // data is a free form string to pass arguments to the creation | 76 // data is a free form string to pass arguments to the creation |
78 // process. This is useful to tell e.g. where to find data | 77 // process. This is useful to tell e.g. where to find data |
79 // in the file system to be used for importing. | 78 // in the file system to be used for importing. |
80 Create(kind JobKind, data string) (Job, error) | 79 Create(data string) (Job, error) |
81 // Depends returns a list of ressources locked by this type of import. | 80 // Depends returns a list of ressources locked by this type of import. |
82 // Imports are run concurrently if they have disjoint sets | 81 // Imports are run concurrently if they have disjoint sets |
83 // of dependencies. | 82 // of dependencies. |
84 Depends() []string | 83 Depends() []string |
85 // StageDone is called if an import is positively reviewed | 84 // StageDone is called if an import is positively reviewed |
587 case q.signalChan <- struct{}{}: | 586 case q.signalChan <- struct{}{}: |
588 default: | 587 default: |
589 } | 588 } |
590 }() | 589 }() |
591 | 590 |
592 job, err := jc.Create(idj.kind, idj.data) | 591 job, err := jc.Create(idj.data) |
593 if err != nil { | 592 if err != nil { |
594 errorAndFail(idj.id, "failed to create job for import #%d: %v", | 593 errorAndFail(idj.id, "failed to create job for import #%d: %v", |
595 idj.id, err) | 594 idj.id, err) |
596 return | 595 return |
597 } | 596 } |