update Di 3. Mär 17:31:01 CET 2020
This commit is contained in:
parent
2800ede80e
commit
9b76250db3
@ -791,7 +791,7 @@ module.exports = function(db, async, app_cfg) {
|
||||
};
|
||||
|
||||
function db_get_waipid_by_uuid(waip_uuid, callback){
|
||||
db.get(`SELECT id FROM WAIP_EINSAETZE WHERE e.uuid like ?`, [waip_uuid], function(err, row) {
|
||||
db.get(`SELECT id FROM WAIP_EINSAETZE WHERE uuid like ?`, [waip_uuid], function(err, row) {
|
||||
if (err == null && row) {
|
||||
callback && callback(row.id);
|
||||
} else {
|
||||
|
||||
@ -77,14 +77,13 @@ module.exports = function(io, sql, async, app_cfg) {
|
||||
if (data) {
|
||||
|
||||
data.forEach(function(row) {
|
||||
// fuer jede Wache(row.room) die verbundenen Sockets(Clients) ermitteln und Einsatz verteilen
|
||||
var room_stockets = io.sockets.adapter.rooms[row.room];
|
||||
if (typeof room_stockets !== 'undefined') {
|
||||
Object.keys(room_stockets.sockets).forEach(function(socket_id) {
|
||||
io.sockets.to(socket_id).emit('io.response', result)
|
||||
sql.db_log('WAIP', 'Rückmeldung ' + result + ' an Socket ' + socket_id + ' gesendet');
|
||||
});
|
||||
};
|
||||
sql.db_get_response_wache(waip_id, row.room, function(result){
|
||||
console.log('response_wache: ' + row.room);
|
||||
if (row.room) {
|
||||
reuckmeldung_verteilen(waip_id, row.room);
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
} else {
|
||||
sql.db_log('Fehler-WAIP', 'Fehler: Wache für waip_id ' + waip_id + ' nicht vorhanden, Rückmeldung konnte nicht verteilt werden!');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user