@audius/sdk 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +19 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/legacy.js +19 -17
- package/dist/legacy.js.map +1 -1
- package/dist/native-libs.js +19 -17
- package/dist/native-libs.js.map +1 -1
- package/dist/sanityChecks/index.d.ts +1 -1
- package/dist/sanityChecks/rolloverNodes.d.ts +1 -1
- package/package.json +2 -2
- package/src/sanityChecks/index.ts +5 -2
- package/src/sanityChecks/rolloverNodes.ts +4 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Nullable } from '../utils';
|
|
2
2
|
import type { AudiusLibs } from '../AudiusLibs';
|
|
3
|
-
export declare const rolloverNodes: (libs: AudiusLibs, creatorNodeWhitelist: Nullable<Set<string>>) => Promise<void>;
|
|
3
|
+
export declare const rolloverNodes: (libs: AudiusLibs, creatorNodeWhitelist: Nullable<Set<string>>, creatorNodeBlacklist: Nullable<Set<string>>) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -19,12 +19,15 @@ export class SanityChecks {
|
|
|
19
19
|
/**
|
|
20
20
|
* Runs sanity checks
|
|
21
21
|
*/
|
|
22
|
-
async run(
|
|
22
|
+
async run(
|
|
23
|
+
creatorNodeWhitelist: Nullable<Set<string>> = null,
|
|
24
|
+
creatorNodeBlacklist: Nullable<Set<string>> = null
|
|
25
|
+
) {
|
|
23
26
|
await addSecondaries(this.libs)
|
|
24
27
|
await assignReplicaSetIfNecessary(this.libs)
|
|
25
28
|
await syncNodes(this.libs)
|
|
26
29
|
if (!this.options.skipRollover) {
|
|
27
|
-
await rolloverNodes(this.libs, creatorNodeWhitelist)
|
|
30
|
+
await rolloverNodes(this.libs, creatorNodeWhitelist, creatorNodeBlacklist)
|
|
28
31
|
}
|
|
29
32
|
await needsRecoveryEmail(this.libs)
|
|
30
33
|
}
|
|
@@ -36,7 +36,8 @@ const getNewPrimary = async (libs: AudiusLibs, secondaries: string[]) => {
|
|
|
36
36
|
|
|
37
37
|
export const rolloverNodes = async (
|
|
38
38
|
libs: AudiusLibs,
|
|
39
|
-
creatorNodeWhitelist: Nullable<Set<string
|
|
39
|
+
creatorNodeWhitelist: Nullable<Set<string>>,
|
|
40
|
+
creatorNodeBlacklist: Nullable<Set<string>>
|
|
40
41
|
) => {
|
|
41
42
|
console.debug('Sanity Check - rolloverNodes')
|
|
42
43
|
const user = libs.userStateManager?.getCurrentUser()
|
|
@@ -45,8 +46,9 @@ export const rolloverNodes = async (
|
|
|
45
46
|
|
|
46
47
|
const primary = CreatorNode.getPrimary(user.creator_node_endpoint)
|
|
47
48
|
if (!primary) return
|
|
49
|
+
|
|
48
50
|
const healthy = await checkPrimaryHealthy(libs, primary, MAX_TRIES)
|
|
49
|
-
if (healthy) return
|
|
51
|
+
if (healthy && !creatorNodeBlacklist?.has(primary)) return
|
|
50
52
|
|
|
51
53
|
const secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint)
|
|
52
54
|
|