Skip to content

Commit

Permalink
colossus: allow startup with any worker id
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaamani committed Jul 16, 2023
1 parent b87ee64 commit e1d2834
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions storage-node/src/commands/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,16 @@ Supported values: warn, error, debug, info. Default:debug`,
const workerId = flags.worker

if (!(await verifyWorkerId(api, workerId))) {
logger.error(`workerId ${workerId} does not exist in the storage working group`)
this.exit(ExitCodes.InvalidWorkerId)
logger.warn(`workerId ${workerId} does not exist in the storage working group`)
// this.exit(ExitCodes.InvalidWorkerId)
}

const qnApi = new QueryNodeApi(flags.queryNodeEndpoint)

const selectedBucketsAndAccounts = await constructBucketToAddressMapping(api, qnApi, workerId, flags.buckets)

if (!selectedBucketsAndAccounts.length) {
this.error('No buckets to serve! Cannot proceed')
logger.warn('No buckets to serve. Server will be idle!')
}

const keystoreAddresses = this.getUnlockedAccounts()
Expand Down Expand Up @@ -205,8 +205,10 @@ Supported values: warn, error, debug, info. Default:debug`,
await this.ensureDevelopmentChain()
}

if (flags.sync) {
logger.info(`Synchronization enabled.`)
// Don't run sync job if no buckets selected, to prevent purging
// any assets.
if (flags.sync && selectedBuckets.length) {
logger.info(`Synchronization is Enabled.`)
setTimeout(
// eslint-disable-next-line @typescript-eslint/no-misused-promises
async () =>
Expand All @@ -223,6 +225,8 @@ Supported values: warn, error, debug, info. Default:debug`,
),
0
)
} else {
logger.warn(`Synchronization is Disabled.`)
}

try {
Expand Down

0 comments on commit e1d2834

Please sign in to comment.