Skip to content

Commit

Permalink
fix: attempt to fix len 0 at index 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cyperdark authored and KotRikD committed Feb 15, 2024
1 parent 0f8379c commit 49a08da
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/tosu/src/objects/instanceManager/instanceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ export class InstanceManager {
delete this.osuInstances[pid];
}

async runWatcher() {
while (true) {
private handleProcesses() {
try {
const osuProcesses = process_by_name('osu!.exe');

for (const process of osuProcesses || []) {
if (process.pid in this.osuInstances) {
// dont deploy not needed instances
Expand All @@ -48,6 +47,14 @@ export class InstanceManager {
this.osuInstances[process.pid] = osuInstance;
osuInstance.start();
}
} catch (error) {
console.log(error);
}
}

async runWatcher() {
while (true) {
this.handleProcesses();

await sleep(5000);
}
Expand Down

0 comments on commit 49a08da

Please sign in to comment.