ethersphere/gateway-proxy

Content reupload starts setInterval with minimum delay when it should be turned off

Cafe137 opened this issue · 1 comments

Starting with env: {
  PATH: '/Users/aron/.nvm/versions/node/v16.16.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
  EXPOSE_HASHED_IDENTITY: 'true',
  HOSTNAME: 'bzz-link.local'
}

Output:

time="2022-10-04T20:58:28.901Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.904Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.908Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.910Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.911Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.911Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.912Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.912Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.912Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.913Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.915Z" level="info" msg="no pins found"
time="2022-10-04T20:58:28.915Z" level="info" msg="no pins found"

I think the problem lies in config.ts

export function getContentConfig({ BEE_API_URL, REUPLOAD_PERIOD }: EnvironmentVariables = {}): ContentConfig {
  return {
    beeApiUrl: BEE_API_URL || DEFAULT_BEE_API_URL,
    refreshPeriod: Number(REUPLOAD_PERIOD),
  }
}

This should return something falsy IMO when REUPLOAD_PERIOD is undefined

So this code is not triggered:

  if (contentConfig) {
    logger.debug('content config', contentConfig)
    const contentManager = new ContentManager()
    logger.info('starting content manager')
    contentManager.start(contentConfig)
  }