MVP
This commit is contained in:
14
startup_recovery_query.js
Normal file
14
startup_recovery_query.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// ===== STARTUP RECOVERY QUERY =====
|
||||
// This function should be triggered on Node-RED startup via an inject node
|
||||
// with "Inject once after 0.1 seconds"
|
||||
|
||||
// Query for most recent active session
|
||||
msg.topic = `
|
||||
SELECT * FROM session_state
|
||||
WHERE is_active = 1
|
||||
ORDER BY updated_at DESC
|
||||
LIMIT 1;
|
||||
`;
|
||||
|
||||
msg._mode = "startup-recovery-query";
|
||||
return msg;
|
||||
Reference in New Issue
Block a user