Skip to content

Commit

Permalink
Clean up sanity checks (#3658)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmanjunath committed Sep 19, 2022
1 parent e12947e commit 05d7766
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 127 deletions.
13 changes: 2 additions & 11 deletions libs/src/sanityChecks/index.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
import { sanitizeNodes } from './sanitizeNodes'
import { addSecondaries } from './addSecondaries'
import { syncNodes } from './syncNodes'
import { rolloverNodes } from './rolloverNodes'
import { needsRecoveryEmail } from './needsRecoveryEmail'
import { assignReplicaSetIfNecessary } from './assignReplicaSetIfNecessary'
import type { AudiusLibs } from '../AudiusLibs'
import type { Nullable } from '../utils'

// Checks to run at startup to ensure a user is in a good state.
export class SanityChecks {
libs: AudiusLibs
options: { skipRollover: boolean }

constructor(libsInstance: AudiusLibs, options = { skipRollover: false }) {
constructor(libsInstance: AudiusLibs) {
this.libs = libsInstance
this.options = options
}

/**
* Runs sanity checks
*/
async run(creatorNodeWhitelist: Nullable<Set<string>> = null) {
await sanitizeNodes(this.libs)
async run() {
await addSecondaries(this.libs)
await assignReplicaSetIfNecessary(this.libs)
await syncNodes(this.libs)
if (!this.options.skipRollover) {
await rolloverNodes(this.libs, creatorNodeWhitelist)
}
await needsRecoveryEmail(this.libs)
}
}
90 changes: 0 additions & 90 deletions libs/src/sanityChecks/rolloverNodes.ts

This file was deleted.

26 changes: 0 additions & 26 deletions libs/src/sanityChecks/sanitizeNodes.ts

This file was deleted.

0 comments on commit 05d7766

Please sign in to comment.