Small component rename

This commit is contained in:
Pinga 2023-12-09 01:05:08 +02:00
parent 2b9cffd634
commit 6907049880
2 changed files with 10 additions and 6 deletions

View file

@ -26,11 +26,14 @@ require_once 'helpers.php';
$server = new Server("127.0.0.1", 8250); $server = new Server("127.0.0.1", 8250);
$server->set([ $server->set([
'daemonize' => false, 'daemonize' => false,
'log_file' => '/var/log/namingo/notifications.log', 'log_file' => '/var/log/namingo/messagebroker_application.log',
'log_level' => SWOOLE_LOG_INFO, 'log_level' => SWOOLE_LOG_INFO,
'worker_num' => swoole_cpu_num() * 2, 'worker_num' => swoole_cpu_num() * 2,
'pid_file' => '/var/run/notifications.pid' 'pid_file' => '/var/run/messagebroker.pid'
]); ]);
$logFilePath = '/var/log/namingo/messagebroker.log';
$log = setupLogger($logFilePath, 'Message_Broker');
$log->info('job started.');
$server->on("request", function (Request $request, Response $response) use ($c) { $server->on("request", function (Request $request, Response $response) use ($c) {
// Parse the received data // Parse the received data
@ -133,6 +136,7 @@ $server->on("request", function (Request $request, Response $response) use ($c)
return; return;
} }
$log->info('job finished successfully.');
$response->end(json_encode(['status' => 'success'])); $response->end(json_encode(['status' => 'success']));
}); });

View file

@ -364,15 +364,15 @@ or
composer require phpmailer/phpmailer composer require phpmailer/phpmailer
``` ```
This command will install one of the packages which are essential for the notification script to function correctly. This command will install one of the packages which are essential for the message broker script to function correctly.
### Configuring the Crontab for Automation Scripts ### Configuring the Crontab for Automation Scripts
To set up automated tasks for Namingo, open the example crontab file located at ```/opt/registry/automation/crontab.example```. Review the contents and copy the relevant lines into your system's crontab file. Remember to adjust the paths and timings as necessary to suit your environment. To set up automated tasks for Namingo, open the example crontab file located at ```/opt/registry/automation/crontab.example```. Review the contents and copy the relevant lines into your system's crontab file. Remember to adjust the paths and timings as necessary to suit your environment.
### Running the `notifications.php` Script in the Background ### Running the `messagebroker.php` Script in the Background
To run the notifications.php script as a background process, execute the following command: ```/usr/bin/php /opt/registry/automation/notifications.php &```. This will start the script and place it in the background, allowing it to run independently of your current terminal session. To run the messagebroker.php script as a background process, execute the following command: ```/usr/bin/php /opt/registry/automation/messagebroker.php &```. This will start the script and place it in the background, allowing it to run independently of your current terminal session.
### Setting Up an Audit Trail Database for Namingo ### Setting Up an Audit Trail Database for Namingo