CAT polling interval into config file

This commit is contained in:
Szymon Porwolik
2025-10-23 19:57:06 +02:00
parent a0434eeb38
commit 4e67b783f5
2 changed files with 28 additions and 6 deletions

View File

@@ -727,6 +727,26 @@ $config['cron_allow_insecure'] = false;
$config['disable_version_check'] = false;
/*
|--------------------------------------------------------------------------
| CAT Configuration
|--------------------------------------------------------------------------
|
| This defines various CAT related settings. More information can be found
| on the Wiki: https://github.com/wavelog/Wavelog/wiki/CAT
|
| cat_poll_interval Polling interval for CAT in milliseconds
| Default is 3000ms (3 seconds)
| This control how often the CAT status is
| polled from the radio, in milliseconds.
| Lower values increase the load on the server,
| higher values make the CAT less responsive.
| Good values are between 250ms and 5000ms.
|
|*/
$config['cat_poll_interval'] = 3000;
/*
|--------------------------------------------------------------------------
| trx-control Configuration
@@ -761,7 +781,7 @@ $config['disable_version_check'] = false;
/*
|--------------------------------------------------------------------------
| eqsl.cc Massdownloa
| eqsl.cc Massdownload
|--------------------------------------------------------------------------
|
| The eqsl.cc mass download function is not threadsafe. So it is disabled by default.
@@ -782,7 +802,7 @@ $config['max_login_attempts'] = 3;
|--------------------------------------------------------------------------
| Disable User QSO Count in User List (Admin Menu)
| Reason for this setting is to prevent performance issues on large installations
| where the QSO count is not needed. Set to true to disable the QSO count.
| where the QSO count is not needed. Set to true to disable the QSO count.
| This also hides the last Operator for CLubstations. Default is false.
|--------------------------------------------------------------------------
*/

View File

@@ -1574,12 +1574,14 @@ mymap.on('mousemove', onQsoMapMove);
};
// Update frequency from CAT
// Add a small delay (500ms) before first poll to allow radio interface to initialize
// Add a small delay before first poll to allow radio interface to initialize
var catPollInterval = <?php echo $this->config->item('cat_poll_interval') ?? 500; ?>;
setTimeout(function() {
updateFromCAT();
// Then poll every 500ms
setInterval(updateFromCAT, 500 * 1); // Note: this is minimum update intervals, there is a lock mechanism to prevent overlapping calls.
}, 500);
// Then poll at configured interval
setInterval(updateFromCAT, catPollInterval); // Note: this is minimum update intervals, there is a lock mechanism to prevent overlapping calls.
}, catPollInterval);
// If a radios selected from drop down select radio update.
$('.radios').change(updateFromCAT);