#6 - WIP
This commit is contained in:
@@ -51,7 +51,7 @@ function execute($taskName) {
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
logInfo("Task $taskName failed execution");
|
||||
var_dump($taskName);
|
||||
var_dump($ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ services:
|
||||
links:
|
||||
- mongo:database
|
||||
volumes:
|
||||
- ./persistence/webserver/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||
- ./persistence/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||
- §PROJECT_BUILDNAME§-ws-log:/var/log/§PROJECT_AUTHOR§/
|
||||
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||
logging:
|
||||
@@ -53,9 +53,14 @@ services:
|
||||
links:
|
||||
- mongo:database
|
||||
volumes:
|
||||
- ./persistence/worker/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||
- ./persistence/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||
- §PROJECT_BUILDNAME§-wk-log:/var/log/§PROJECT_AUTHOR§/
|
||||
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-file: "5"
|
||||
max-size: "150m"
|
||||
memcached:
|
||||
image: memcached:1.6.9-alpine
|
||||
restart: "on-failure:3"
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
$tasks = array("SendBackupTask");
|
||||
|
||||
if (sizeof($tasks)>0){
|
||||
foreach ($tasks as $taskName){
|
||||
try {
|
||||
if ($taskName::isActive()){
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
||||
$taskName::execute();
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
||||
}
|
||||
}catch (CoreException $ex){
|
||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
catch (Exception $ex){
|
||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// try {
|
||||
|
||||
|
||||
// }catch (UNHADBException $unex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
||||
// }
|
||||
// catch (Exception $ex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
||||
// }
|
||||
|
||||
?>
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
$tasks = array("NewsletterCheckTask","DeleteOldPasswordResetRequestsTask", "UpdateMeteoCacheTask", "GenerateCommentiWarningMailTask");
|
||||
|
||||
if (sizeof($tasks)>0){
|
||||
foreach ($tasks as $taskName){
|
||||
try {
|
||||
if ($taskName::isActive()){
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
||||
$taskName::execute();
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
||||
}
|
||||
}catch (CoreException $ex){
|
||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
catch (Exception $ex){
|
||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// try {
|
||||
// SystemController::executeTask("RefreshApiCache.php");
|
||||
// }
|
||||
// catch (UNHADBException $unex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("GenerateReminderMail.php",$msg),true);
|
||||
|
||||
// }
|
||||
// catch (Exception $ex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("GenerateReminderMail.php",$msg),true);
|
||||
|
||||
// }
|
||||
|
||||
?>
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/*
|
||||
Author: Riccardo Di Dato
|
||||
Creation Date: 12/gen/2016
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
$tasks = array(
|
||||
"GenerateAdminActivationMailTask",
|
||||
"GenerateUserActivationMailTask",
|
||||
"GenerateAdminPasswordRecoveryMailTask",
|
||||
"GenerateUserPasswordRecoveryMailTask",
|
||||
"MailSendTask",
|
||||
);
|
||||
|
||||
if (sizeof($tasks)>0){
|
||||
foreach ($tasks as $taskName){
|
||||
try {
|
||||
if ($taskName::isActive()){
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
||||
$taskName::execute();
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
||||
}
|
||||
}catch (CoreException $ex){
|
||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
catch (Exception $ex){
|
||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user