Skip to content

Commit

Permalink
[DPO3DPKRT-752] decouple explicit storage path in workflow (#580)
Browse files Browse the repository at this point in the history
now using storage interface to get paths for capture data uploads
  • Loading branch information
EMaslowskiQ authored Apr 11, 2024
1 parent b0e6577 commit 841b082
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions server/workflow/impl/Packrat/WorkflowUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as STORE from '../../../storage/interface';
import * as REP from '../../../report/interface';
import * as LOG from '../../../utils/logger';
import * as H from '../../../utils/helpers';
import { Config } from '../../../config';
import { ZipFile } from '../../../utils';
import { SvxReader } from '../../../utils/parser';

Expand Down Expand Up @@ -112,10 +111,18 @@ export class WorkflowUpload implements WF.IWorkflow {
// we are not a zip
fileRes = await this.validateFile(RSR.fileName, RSR.readStream, false, idSystemObject, asset);
} else {

// it's not a model (e.g. Capture Data)
// grab our storage instance
const storage: STORE.IStorage | null = await STORE.StorageFactory.getInstance(); /* istanbul ignore next */
if (!storage) {
const error: string = 'WorkflowUpload.validateFiles: Unable to retrieve Storage Implementation from StorageFactory.getInstace()';
return this.handleError(error);
}

// figure out our path
const filePath: string = await storage.stagingFileName(assetVersion.StorageKeyStaging);

// use ZipFile so we don't need to load it all into memory
const filePath: string = Config.storage.rootStaging+'/'+assetVersion.StorageKeyStaging;
const ZS: ZipFile = new ZipFile(filePath);
const zipRes: H.IOResults = await ZS.load();
if (!zipRes.success)
Expand Down

0 comments on commit 841b082

Please sign in to comment.