chore: remove cached function

This commit is contained in:
Ralph Khreish
2025-05-16 22:19:45 +02:00
parent 0393e0fb14
commit 8a23ba9b2c
3 changed files with 6 additions and 24 deletions

View File

@@ -8,7 +8,6 @@ import {
enableSilentMode, enableSilentMode,
disableSilentMode disableSilentMode
} from '../../../../scripts/modules/utils.js'; } from '../../../../scripts/modules/utils.js';
import { getCachedOrExecute } from '../../tools/utils.js';
/** /**
* Direct function wrapper for displaying the complexity report with error handling and caching. * Direct function wrapper for displaying the complexity report with error handling and caching.
@@ -86,30 +85,20 @@ export async function complexityReportDirect(args, log) {
// Use the caching utility // Use the caching utility
try { try {
const result = await getCachedOrExecute({ const result = await coreActionFn();
cacheKey, log.info('complexityReportDirect completed');
actionFn: coreActionFn, return result;
log
});
log.info(
`complexityReportDirect completed. From cache: ${result.fromCache}`
);
return result; // Returns { success, data/error, fromCache }
} catch (error) { } catch (error) {
// Catch unexpected errors from getCachedOrExecute itself
// Ensure silent mode is disabled // Ensure silent mode is disabled
disableSilentMode(); disableSilentMode();
log.error( log.error(`Unexpected error during complexityReport: ${error.message}`);
`Unexpected error during getCachedOrExecute for complexityReport: ${error.message}`
);
return { return {
success: false, success: false,
error: { error: {
code: 'UNEXPECTED_ERROR', code: 'UNEXPECTED_ERROR',
message: error.message message: error.message
}, }
fromCache: false
}; };
} }
} catch (error) { } catch (error) {

View File

@@ -5,7 +5,6 @@
import { findNextTask } from '../../../../scripts/modules/task-manager.js'; import { findNextTask } from '../../../../scripts/modules/task-manager.js';
import { readJSON } from '../../../../scripts/modules/utils.js'; import { readJSON } from '../../../../scripts/modules/utils.js';
import { getCachedOrExecute } from '../../tools/utils.js';
import { import {
enableSilentMode, enableSilentMode,
disableSilentMode disableSilentMode
@@ -117,9 +116,8 @@ export async function nextTaskDirect(args, log) {
try { try {
const result = await coreNextTaskAction(); const result = await coreNextTaskAction();
log.info(`nextTaskDirect completed.`); log.info(`nextTaskDirect completed.`);
return result; // Returns { success, data/error, fromCache } return result;
} catch (error) { } catch (error) {
// Catch unexpected errors from getCachedOrExecute itself
log.error(`Unexpected error during nextTask: ${error.message}`); log.error(`Unexpected error during nextTask: ${error.message}`);
return { return {
success: false, success: false,

View File

@@ -4,11 +4,6 @@
*/ */
import { findTaskById, readJSON } from '../../../../scripts/modules/utils.js'; import { findTaskById, readJSON } from '../../../../scripts/modules/utils.js';
import { getCachedOrExecute } from '../../tools/utils.js';
import {
enableSilentMode,
disableSilentMode
} from '../../../../scripts/modules/utils.js';
import { findTasksJsonPath } from '../utils/path-utils.js'; import { findTasksJsonPath } from '../utils/path-utils.js';
/** /**