Exemple #1
0
        public void RunJob(JobRunModel model)
        {
            //Instanciate plugins depending on class name
            Job job = PluginStorage.CreateObject <Job>(
                //Go Fetch class name from config file
                JObject.Parse(File.ReadAllText("jobs\\" + model.Name + "\\config.json")).Value <string>("_class")
                );

            //Load job from folder configuration
            job.LoadFromFolder("jobs", model.Name);

            //Create Logger list for the run
            LoggerList loggers = new LoggerList();

            //Add Standard logger in the logger list
            loggers.AddLogger(new StandardLogger());

            //Add job build in the process with his name as key and provide log
            _threadApplication.AddRun(model.Name, job, loggers);
        }
Exemple #2
0
 public IActionResult Run([FromBody] JobRunModel model)
 {
     _jobApplication.RunJob(model);
     return(Ok());
 }