How to use the @cumulus/ingest/granule.moveGranuleFiles function in @cumulus/ingest

To help you get started, we’ve selected a few @cumulus/ingest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nasa / cumulus / packages / api / models / granules.js View on Github external
async move(g, destinations, distEndpoint) {
    log.info(`granules.move ${g.granuleId}`);
    const files = clonedeep(g.files);
    await moveGranuleFiles(g.granuleId, files, destinations, distEndpoint, g.published);
    await this.update({ granuleId: g.granuleId }, { files: files });
  }
github nasa / cumulus / packages / api / models / granules.js View on Github external
async move(g, destinations, distEndpoint) {
    log.info(`granules.move ${g.granuleId}`);

    const updatedFiles = await moveGranuleFiles(g.files, destinations);

    await cmrjs.reconcileCMRMetadata({
      granuleId: g.granuleId,
      updatedFiles,
      distEndpoint,
      published: g.published
    });

    return this.update(
      { granuleId: g.granuleId },
      {
        files: updatedFiles.map(partial(renameProperty, 'name', 'fileName'))
      }
    );
  }