mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 10:46:17 +00:00
Compare commits
6 Commits
fix/get-co
...
revert-426
Author | SHA1 | Date | |
---|---|---|---|
c8d691b380 | |||
75d03366c2 | |||
52cb69cc84 | |||
a6053b3971 | |||
60d2c8330b | |||
fddd06e06d |
@ -125,7 +125,7 @@ import { VisitorPasswordEntity } from '../modules/visitor-password/entities';
|
|||||||
logger: typeOrmLogger,
|
logger: typeOrmLogger,
|
||||||
extra: {
|
extra: {
|
||||||
charset: 'utf8mb4',
|
charset: 'utf8mb4',
|
||||||
max: 50, // set pool max size
|
max: 100, // set pool max size
|
||||||
idleTimeoutMillis: 5000, // close idle clients after 5 second
|
idleTimeoutMillis: 5000, // close idle clients after 5 second
|
||||||
connectionTimeoutMillis: 12_000, // return an error after 11 second if connection could not be established
|
connectionTimeoutMillis: 12_000, // return an error after 11 second if connection could not be established
|
||||||
maxUses: 7500, // close (and replace) a connection after it has been used 7500 times (see below for discussion)
|
maxUses: 7500, // close (and replace) a connection after it has been used 7500 times (see below for discussion)
|
||||||
|
@ -245,30 +245,30 @@ export class DeviceStatusFirebaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
// if (
|
||||||
addDeviceStatusDto.productType === ProductType.CPS ||
|
// addDeviceStatusDto.productType === ProductType.CPS ||
|
||||||
addDeviceStatusDto.productType === ProductType.WPS
|
// addDeviceStatusDto.productType === ProductType.WPS
|
||||||
) {
|
// ) {
|
||||||
const occupancyCodes = new Set([PresenceSensorEnum.PRESENCE_STATE]);
|
// const occupancyCodes = new Set([PresenceSensorEnum.PRESENCE_STATE]);
|
||||||
|
|
||||||
const occupancyStatus = addDeviceStatusDto?.log?.properties?.find(
|
// const occupancyStatus = addDeviceStatusDto?.log?.properties?.find(
|
||||||
(status) => occupancyCodes.has(status.code),
|
// (status) => occupancyCodes.has(status.code),
|
||||||
);
|
// );
|
||||||
|
|
||||||
if (occupancyStatus) {
|
// if (occupancyStatus) {
|
||||||
await this.occupancyService.updateOccupancySensorHistoricalData(
|
// await this.occupancyService.updateOccupancySensorHistoricalData(
|
||||||
addDeviceStatusDto.deviceUuid,
|
// addDeviceStatusDto.deviceUuid,
|
||||||
);
|
// );
|
||||||
await this.occupancyService.updateOccupancySensorHistoricalDurationData(
|
// await this.occupancyService.updateOccupancySensorHistoricalDurationData(
|
||||||
addDeviceStatusDto.deviceUuid,
|
// addDeviceStatusDto.deviceUuid,
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (addDeviceStatusDto.productType === ProductType.AQI) {
|
// if (addDeviceStatusDto.productType === ProductType.AQI) {
|
||||||
await this.aqiDataService.updateAQISensorHistoricalData(
|
// await this.aqiDataService.updateAQISensorHistoricalData(
|
||||||
addDeviceStatusDto.deviceUuid,
|
// addDeviceStatusDto.deviceUuid,
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
// Return the updated data
|
// Return the updated data
|
||||||
const snapshot: DataSnapshot = await get(dataRef);
|
const snapshot: DataSnapshot = await get(dataRef);
|
||||||
return snapshot.val();
|
return snapshot.val();
|
||||||
|
Reference in New Issue
Block a user