WIP: Untested, solo caricati file di test
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
/******************************************
|
||||
* Author : Riccardo Di Dato
|
||||
* Created On : Tue Sep 22 2020
|
||||
* File : processJobs.php
|
||||
*******************************************/
|
||||
|
||||
use ASD\Context;
|
||||
use ASD\DB\DaoRegistry;
|
||||
use ASD\Job\JobExecutor;
|
||||
use ASD\Job\LocalFilesystemComunicationStrategy;
|
||||
use ASD\Job\LogManagerLoggingStrategy;
|
||||
use ASD\Job\MongoJobStorageClass;
|
||||
use ASD\Job\RunnableJobFactory;
|
||||
use ASD\Job\SingleJobExecutionStrategy;
|
||||
|
||||
$buildName = getenv("ASD_BUILDNAME");
|
||||
require_once ("/home/asdynamics/private/$buildName/load.php");
|
||||
|
||||
try{
|
||||
|
||||
$jobFactory = new RunnableJobFactory();
|
||||
|
||||
|
||||
$storageClass = new MongoJobStorageClass(DaoRegistry::getDefaultMongo(), $jobFactory);
|
||||
$comStrategy = new LocalFilesystemComunicationStrategy(
|
||||
Context::getEnvironment()->getFilePath("comunication.shutdown"),
|
||||
Context::getEnvironment()->getFilePath("comunication.execution"),
|
||||
Context::getEnvironment()->getFilePath("comunication.idle")
|
||||
);
|
||||
$execStrat = new SingleJobExecutionStrategy();
|
||||
$logStrategy = new LogManagerLoggingStrategy("job");
|
||||
|
||||
$executor = new JobExecutor($storageClass, $comStrategy, $execStrat, $logStrategy );
|
||||
$executor->run();
|
||||
exit(0);
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
var_dump($ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user