wip: add analysis runner / agent, separate Server/Queue/Agent, use New* initializers

This commit is contained in:
Michael Hohn
2024-05-23 15:46:55 -07:00
committed by =Michael Hohn
parent 2ab596bf1d
commit f7155eba50
10 changed files with 209 additions and 22 deletions

View File

@@ -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,

View File

@@ -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 {