feat: implement dynamic agent detection, automatic default account seeding, and strict data isolation filtering
This commit is contained in:
1 parent
8cd4f95856
commit
53008983b3
7 files changed
+208
-17
No files matched your search
@@ -16,6 +16,17 @@ async function runPoll() {
|
||||
console.log(`[Scheduler] Mulai polling... (${fetchedAt})`);
|
||||
|
||||
try {
|
||||
// 0. Sync agents and seed default user accounts dynamically
|
||||
try {
|
||||
const apiAgents = await netify.fetchAgents();
|
||||
if (apiAgents && apiAgents.length > 0) {
|
||||
db.syncAgentUsers(apiAgents);
|
||||
console.log(`[Scheduler] OK Sync Agents : ${apiAgents.length} agen terdeteksi`);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[Scheduler] Gagal sync agent users:', err.message);
|
||||
}
|
||||
|
||||
// 1. Top Aplikasi
|
||||
const apps = await netify.fetchTopApps(1440, 20);
|
||||
if (apps && Array.isArray(apps)) {
|
||||
|
||||
Reference in new issue
Block a user