Create timestamp file in variant analysis storage directory
This commit is contained in:
@@ -280,6 +280,8 @@ export async function runRemoteQuery(
|
|||||||
|
|
||||||
variantAnalysisManager.onVariantAnalysisSubmitted(processedVariantAnalysis);
|
variantAnalysisManager.onVariantAnalysisSubmitted(processedVariantAnalysis);
|
||||||
|
|
||||||
|
await variantAnalysisManager.prepareStorageDirectory(processedVariantAnalysis.id);
|
||||||
|
|
||||||
void logger.log(`Variant analysis:\n${JSON.stringify(processedVariantAnalysis, null, 2)}`);
|
void logger.log(`Variant analysis:\n${JSON.stringify(processedVariantAnalysis, null, 2)}`);
|
||||||
|
|
||||||
void showAndLogInformationMessage(`Variant analysis ${processedVariantAnalysis.query.name} submitted for processing`);
|
void showAndLogInformationMessage(`Variant analysis ${processedVariantAnalysis.query.name} submitted for processing`);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import { CodeQLCliServer } from '../cli';
|
|||||||
import { getControllerRepo } from './run-remote-query';
|
import { getControllerRepo } from './run-remote-query';
|
||||||
import { processUpdatedVariantAnalysis } from './variant-analysis-processor';
|
import { processUpdatedVariantAnalysis } from './variant-analysis-processor';
|
||||||
import PQueue from 'p-queue';
|
import PQueue from 'p-queue';
|
||||||
|
import { createTimestampFile } from '../helpers';
|
||||||
|
|
||||||
export class VariantAnalysisManager extends DisposableObject implements VariantAnalysisViewManager<VariantAnalysisView> {
|
export class VariantAnalysisManager extends DisposableObject implements VariantAnalysisViewManager<VariantAnalysisView> {
|
||||||
private readonly _onVariantAnalysisAdded = this.push(new EventEmitter<VariantAnalysis>());
|
private readonly _onVariantAnalysisAdded = this.push(new EventEmitter<VariantAnalysis>());
|
||||||
@@ -180,6 +181,16 @@ export class VariantAnalysisManager extends DisposableObject implements VariantA
|
|||||||
return this.variantAnalysisResultsManager.getStorageDirectory(variantAnalysisId);
|
return this.variantAnalysisResultsManager.getStorageDirectory(variantAnalysisId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares a directory for storing results for a variant analysis.
|
||||||
|
* This directory contains a timestamp file, which will be
|
||||||
|
* used by the query history manager to determine when the directory
|
||||||
|
* should be deleted.
|
||||||
|
*/
|
||||||
|
public async prepareStorageDirectory(variantAnalysisId: number): Promise<void> {
|
||||||
|
await createTimestampFile(this.getVariantAnalysisStorageLocation(variantAnalysisId));
|
||||||
|
}
|
||||||
|
|
||||||
public async promptOpenVariantAnalysis() {
|
public async promptOpenVariantAnalysis() {
|
||||||
const credentials = await Credentials.initialize(this.ctx);
|
const credentials = await Credentials.initialize(this.ctx);
|
||||||
if (!credentials) { throw Error('Error authenticating with GitHub'); }
|
if (!credentials) { throw Error('Error authenticating with GitHub'); }
|
||||||
|
|||||||
Reference in New Issue
Block a user