hyperjumptech/monika

[SymonClient] Simplify initiate process

Closed this issue · 0 comments

Currently, when SymonClient is initiated, it will attempt a handshake with Symon. Then, it will set the Monika status to online.

monika/src/symon/index.ts

Lines 172 to 184 in 6ddf49e

async initiate(): Promise<void> {
log.info('[Symon] Handshake starts')
this.monikaId = await this.handshake()
log.info('[Symon] Handshake succeed')
log.info('[Symon] Send status')
this.sendStatus({ isOnline: true })
.then(() => {
log.info('[Symon] Send status succeed')
})
.catch((error) => {
log.error(`[Symon] Send status failed. ${(error as Error).message}`)
})

The .sendStatus() method can be removed, considering there is a plan to set the Monika status to online in the handshake API