mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-10-29 18:02:27 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -75,6 +75,7 @@ if [[ "$TEMPLATE_CONFIG" = 'true' ]]; then
|
|||||||
STORAGE_TYPE_MYSQL_PORT=${STORAGE_TYPE_MYSQL_PORT:-"3306"} \
|
STORAGE_TYPE_MYSQL_PORT=${STORAGE_TYPE_MYSQL_PORT:-"3306"} \
|
||||||
CERTIFICATES_ALLOWMISMATCH=${CERTIFICATES_ALLOWMISMATCH:-"false"} \
|
CERTIFICATES_ALLOWMISMATCH=${CERTIFICATES_ALLOWMISMATCH:-"false"} \
|
||||||
IPINFO_DEFAULT_COUNTRY=${IPINFO_DEFAULT_COUNTRY:-"US"} \
|
IPINFO_DEFAULT_COUNTRY=${IPINFO_DEFAULT_COUNTRY:-"US"} \
|
||||||
|
DEVICE_SESSION_TIMEOUT=${DEVICE_SESSION_TIMEOUT:-"600"} \
|
||||||
envsubst < /owgw.properties.tmpl > $OWGW_CONFIG/owgw.properties
|
envsubst < /owgw.properties.tmpl > $OWGW_CONFIG/owgw.properties
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ iptocountry.ipdata.apikey = ${IPTOCOUNTRY_IPDATA_APIKEY}
|
|||||||
|
|
||||||
autoprovisioning.process = ${AUTOPROVISIONING_PROCESS}
|
autoprovisioning.process = ${AUTOPROVISIONING_PROCESS}
|
||||||
|
|
||||||
|
openwifi.session.timeout = ${DEVICE_SESSION_TIMEOUT}
|
||||||
#
|
#
|
||||||
# rtty
|
# rtty
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ namespace OpenWifi {
|
|||||||
MicroServiceConfigGetBool("openwifi.certificates.allowmismatch", true);
|
MicroServiceConfigGetBool("openwifi.certificates.allowmismatch", true);
|
||||||
MismatchDepth_ = MicroServiceConfigGetInt("openwifi.certificates.mismatchdepth", 2);
|
MismatchDepth_ = MicroServiceConfigGetInt("openwifi.certificates.mismatchdepth", 2);
|
||||||
|
|
||||||
|
SessionTimeOut_ = MicroServiceConfigGetInt("openwifi.session.timeout", 10*60);
|
||||||
|
|
||||||
Reactor_pool_ = std::make_unique<AP_WS_ReactorThreadPool>();
|
Reactor_pool_ = std::make_unique<AP_WS_ReactorThreadPool>();
|
||||||
Reactor_pool_->Start();
|
Reactor_pool_->Start();
|
||||||
|
|
||||||
@@ -188,8 +190,9 @@ namespace OpenWifi {
|
|||||||
while (hint != end(SerialNumbers_)) {
|
while (hint != end(SerialNumbers_)) {
|
||||||
if (hint->second.second == nullptr) {
|
if (hint->second.second == nullptr) {
|
||||||
hint = SerialNumbers_.erase(hint);
|
hint = SerialNumbers_.erase(hint);
|
||||||
} else if ((now - hint->second.second->State_.LastContact) > (10 * 60)) {
|
} else if ((now - hint->second.second->State_.LastContact) > SessionTimeOut_) {
|
||||||
hint->second.second->EndConnection(false);
|
hint->second.second->EndConnection(false);
|
||||||
|
poco_information(Logger(),fmt::format("{}: Session seems idle. Controller disconnecting device.", hint->second.second->SerialNumber_));
|
||||||
Sessions_.erase(hint->second.second->State_.sessionId);
|
Sessions_.erase(hint->second.second->State_.sessionId);
|
||||||
Garbage_.push_back(hint->second.second);
|
Garbage_.push_back(hint->second.second);
|
||||||
hint = SerialNumbers_.erase(hint);
|
hint = SerialNumbers_.erase(hint);
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ namespace OpenWifi {
|
|||||||
std::uint64_t NumberOfConnectedDevices_ = 0;
|
std::uint64_t NumberOfConnectedDevices_ = 0;
|
||||||
std::uint64_t AverageDeviceConnectionTime_ = 0;
|
std::uint64_t AverageDeviceConnectionTime_ = 0;
|
||||||
std::uint64_t NumberOfConnectingDevices_ = 0;
|
std::uint64_t NumberOfConnectingDevices_ = 0;
|
||||||
|
std::uint64_t SessionTimeOut_ = 10*60;
|
||||||
mutable std::mutex StatsMutex_;
|
mutable std::mutex StatsMutex_;
|
||||||
std::atomic_uint64_t TX_=0,RX_=0;
|
std::atomic_uint64_t TX_=0,RX_=0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user