summaryrefslogtreecommitdiff
path: root/plugins/jobs/plugin.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-30 11:08:40 +0300
committerValery Piashchynski <[email protected]>2021-06-30 11:08:40 +0300
commit2ac3b240b118961c1a30cc18dd22d08b7fac6516 (patch)
tree25f48908286a05ea78e4049d89f88450d0541f99 /plugins/jobs/plugin.go
parentc0f808bb8c7077e18aa197f024628b9912def58b (diff)
- Update arch diagrams
- Update ephemeral plugin Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/plugin.go')
-rw-r--r--plugins/jobs/plugin.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go
index 8c5a665e..ab7222ae 100644
--- a/plugins/jobs/plugin.go
+++ b/plugins/jobs/plugin.go
@@ -41,7 +41,7 @@ func testListener(data interface{}) {
fmt.Println(data)
}
-func (p *Plugin) Init(cfg config.Configurer, log logger.Logger, server server.Server) error {
+func (p *Plugin) Init(cfg config.Configurer, log logger.Logger, server server.Server, pq priorityqueue.Queue) error {
const op = errors.Op("jobs_plugin_init")
if !cfg.Has(PluginName) {
return errors.E(op, errors.Disabled)
@@ -64,7 +64,7 @@ func (p *Plugin) Init(cfg config.Configurer, log logger.Logger, server server.Se
p.consumers = make(map[string]Consumer)
// initialize priority queue
- p.queue = priorityqueue.NewPriorityQueue()
+ p.queue = pq
p.log = log
return nil
@@ -157,5 +157,8 @@ func (p *Plugin) Push(j *structs.Job) (string, error) {
}
func (p *Plugin) RPC() interface{} {
- return &rpc{log: p.log}
+ return &rpc{
+ log: p.log,
+ p: p,
+ }
}