Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow Run Health Check updates stats and queues #647

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,20 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
return [4 /*yield*/, cli.runCli()];
case 1:
res = _a.sent();
if (!(typeof args.updateStat !== 'undefined')) return [3 /*break*/, 3];
return [4 /*yield*/, args.updateStat(args.originalLibraryFile.DB, 'totalHealthCheckCount', 1)];
case 2:
_a.sent();
_a.label = 3;
case 3:
if (res.cliExitCode !== 0) {
args.jobLog('Running CLI failed');
args.logOutcome('hErr');
throw new Error('Running CLI failed');
}
args.logOutcome('hSuc');
// will cause item to go into the health check success table
args.variables.healthCheck = 'Success';
return [2 /*return*/, {
outputFileObj: args.inputFileObj,
outputNumber: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,22 @@ const plugin = async (args:IpluginInputArgs):Promise<IpluginOutputArgs> => {

const res = await cli.runCli();

// Added in 2.19.01
if (typeof args.updateStat !== 'undefined') {
await args.updateStat(args.originalLibraryFile.DB, 'totalHealthCheckCount', 1);
}

if (res.cliExitCode !== 0) {
args.jobLog('Running CLI failed');
args.logOutcome('hErr');
throw new Error('Running CLI failed');
}

args.logOutcome('hSuc');

// will cause item to go into the health check success table
args.variables.healthCheck = 'Success';

return {
outputFileObj: args.inputFileObj,
outputNumber: 1,
Expand Down
4 changes: 3 additions & 1 deletion FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export interface Ivariables {
ffmpegCommand: IffmpegCommand,
flowFailed: boolean,
user: Record<string, string>,
healthCheck?: 'Success',
}

export interface IpluginOutputArgs {
Expand Down Expand Up @@ -137,7 +138,8 @@ export interface IpluginInputArgs {
updateWorker: IupdateWorker,
logFullCliOutput: boolean,
logOutcome: (outcome: string) => void,
scanIndividualFile?: (filee: IFileObjectMin, scanTypes: IscanTypes) => IFileObject,
scanIndividualFile?: (filee: IFileObjectMin, scanTypes: IscanTypes) => Promise<IFileObject>,
updateStat: (db: string, key: string, inc: number) => Promise<void>,
deps: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fsextra: any,
Expand Down