wip: add analysis runner / agent, separate Server/Queue/Agent, use New* initializers
This commit is contained in:
committed by
=Michael Hohn
parent
2ab596bf1d
commit
f7155eba50
@@ -16,15 +16,11 @@ import (
|
||||
"time"
|
||||
|
||||
"mrvacommander/pkg/common"
|
||||
"mrvacommander/pkg/queue"
|
||||
"mrvacommander/pkg/storage"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
func (c *CommanderSingle) Run() {
|
||||
}
|
||||
|
||||
func (c *CommanderSingle) Setup(st *State) {
|
||||
r := mux.NewRouter()
|
||||
c.st = st
|
||||
@@ -289,7 +285,7 @@ func (c *CommanderSingle) MirvaRequest(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
not_found_repos, analysisRepos := c.st.Storage.FindAvailableDBs(session_repositories)
|
||||
|
||||
queue.StartAnalyses(analysisRepos, session_id, session_language)
|
||||
c.queue.StartAnalyses(analysisRepos, session_id, session_language)
|
||||
|
||||
si := SessionInfo{
|
||||
ID: session_id,
|
||||
|
||||
@@ -26,7 +26,13 @@ type SessionInfo struct {
|
||||
}
|
||||
|
||||
type CommanderSingle struct {
|
||||
st *State
|
||||
st *State
|
||||
queue queue.Queue
|
||||
}
|
||||
|
||||
func NewCommanderSingle(s *State, q queue.Queue) *CommanderSingle {
|
||||
c := CommanderSingle{s, q}
|
||||
return &c
|
||||
}
|
||||
|
||||
type State struct {
|
||||
|
||||
Reference in New Issue
Block a user