- Schedule the recovery job before recording the degraded transition,
so a crash between the two leaves a stray row (removed on the job's
first run) rather than a degraded state nothing is polling
- Count any HTTP response, including 4xx/5xx, as reachable for http
targets; only a transport failure counts against egress
- Cascade a deleted notification out of egressNotifications with an
atomic $pull in the settings repository, after the team-scoped delete
- Handle two processes racing the first egress state insert
- Address global job rows by one key (deleteGlobalJob on _id) and
restore the deleteByIdAndType signature
- Inject net into PingProvider like PortProvider
- Integration tests for MongoEgressStateRepository and the global-row
delete methods on the jobs repository
🔧
13 lines
493 B
TypeScript
13 lines
493 B
TypeScript
import type { Settings, SettingsUpdate } from "@/domain/app-settings/app-settings.type.js";
|
|
export interface ISettingsRepository {
|
|
// create
|
|
create(settings: Partial<Settings>): Promise<Settings>;
|
|
// fetch
|
|
findSingleton(): Promise<Settings | null>;
|
|
// update
|
|
update(settings: SettingsUpdate): Promise<Settings>;
|
|
removeEgressNotification(notificationId: string): Promise<void>; // $pull, so it cannot race a concurrent settings update
|
|
// delete
|
|
deleteLegacy: () => Promise<boolean>;
|
|
}
|