Skip to main content

Function: addHistoryEntry()

addHistoryEntry(db: Database, monitorId: string, entry: StatusHistory, details?: string): void

Defined in: electron/services/database/utils/historyManipulation.ts:61

Internal

Add a new history entry for a monitor.

Parameters

db

Database

Database connection instance

monitorId

string

Unique identifier of the monitor

entry

StatusHistory

StatusHistory object containing check results

details?

string

Optional additional details about the check

Returns

void

Remarks

Transaction Context: This utility function is designed to be called from repository methods that manage transaction context and error handling.

Usage Pattern: Always called from HistoryRepository.addEntryInternal() within an existing transaction context for proper atomicity.

Throws

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error When database insertion fails