File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/remote-queries Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -280,6 +280,8 @@ export async function runRemoteQuery(
280280
281281 variantAnalysisManager . onVariantAnalysisSubmitted ( processedVariantAnalysis ) ;
282282
283+ await variantAnalysisManager . prepareStorageDirectory ( processedVariantAnalysis . id ) ;
284+
283285 void logger . log ( `Variant analysis:\n${ JSON . stringify ( processedVariantAnalysis , null , 2 ) } ` ) ;
284286
285287 void showAndLogInformationMessage ( `Variant analysis ${ processedVariantAnalysis . query . name } submitted for processing` ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { CodeQLCliServer } from '../cli';
2323import { getControllerRepo } from './run-remote-query' ;
2424import { processUpdatedVariantAnalysis } from './variant-analysis-processor' ;
2525import PQueue from 'p-queue' ;
26+ import { createTimestampFile } from '../helpers' ;
2627
2728export class VariantAnalysisManager extends DisposableObject implements VariantAnalysisViewManager < VariantAnalysisView > {
2829 private readonly _onVariantAnalysisAdded = this . push ( new EventEmitter < VariantAnalysis > ( ) ) ;
@@ -180,6 +181,16 @@ export class VariantAnalysisManager extends DisposableObject implements VariantA
180181 return this . variantAnalysisResultsManager . getStorageDirectory ( variantAnalysisId ) ;
181182 }
182183
184+ /**
185+ * Prepares a directory for storing results for a variant analysis.
186+ * This directory contains a timestamp file, which will be
187+ * used by the query history manager to determine when the directory
188+ * should be deleted.
189+ */
190+ public async prepareStorageDirectory ( variantAnalysisId : number ) : Promise < void > {
191+ await createTimestampFile ( this . getVariantAnalysisStorageLocation ( variantAnalysisId ) ) ;
192+ }
193+
183194 public async promptOpenVariantAnalysis ( ) {
184195 const credentials = await Credentials . initialize ( this . ctx ) ;
185196 if ( ! credentials ) { throw Error ( 'Error authenticating with GitHub' ) ; }
You can’t perform that action at this time.
0 commit comments