From 78f065db28b79ce86c7e19e1a050ea26aa8cf4b4 Mon Sep 17 00:00:00 2001 From: Onja Date: Wed, 11 Oct 2023 12:06:45 +0300 Subject: [PATCH] Add event listeners for deleteOldFiles and checkLastOperationDate events, and log corresponding messages --- src/subscribers/consoleSubscriber.js | 45 +++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/subscribers/consoleSubscriber.js b/src/subscribers/consoleSubscriber.js index 9364bb0..76a281b 100644 --- a/src/subscribers/consoleSubscriber.js +++ b/src/subscribers/consoleSubscriber.js @@ -77,4 +77,47 @@ emitter.on('parse.error', ({ filepath, columns, error }) => { // Create a new listener for the parse.data event // emitter.on('parse.data', ({ filepath, columns, data, index }) => { // log('parse.data', `Parsed ${filepath} with columns at index ${index}`); -// }); \ No newline at end of file +// }); + + +// Create a new listener for the deleteOldFiles.start event +emitter.on('deleteOldFiles.start', ({ files, directoryPath }) => { + log('deleteOldFiles.start', `Deleting old files from ${directoryPath}`); +}); + +// Create a new listener for the deleteOldFiles.deleted event +emitter.on('deleteOldFiles.deleted', ({ file, filePath }) => { + log('deleteOldFiles.deleted', `Deleted ${file} from ${filePath}`); +}); + +// Create a new listener for the deleteOldFiles.end event +emitter.on('deleteOldFiles.end', ({ directoryPath }) => { + log('deleteOldFiles.end', `Deleted old files from ${directoryPath}`); +}); + + + +// Create a new listener for the checkLastOperationDate.start event +emitter.on('checkLastOperationDate.start', ({ dateFilePath }) => { + log('checkLastOperationDate.start', `Checking last operation date`); +}); + +// Create a new listener for the checkLastOperationDate.end event +emitter.on('checkLastOperationDate.end', ({ dateFilePath, date }) => { + log('checkLastOperationDate.end', `Checked last operation date: ${date}`); +}); + +// Create a new listener for the checkLastOperationDate.error event +emitter.on('checkLastOperationDate.error', ({ dateFilePath, error }) => { + log('checkLastOperationDate.error', `Error checking last operation date: ${error}`); +}); + +// Create a new listener for the checkLastOperationDate.updated event +emitter.on('checkLastOperationDate.updated', ({ dateFilePath, date }) => { + log('checkLastOperationDate.updated', `Updated last operation date - Old date: ${date}`); +}); + +// Create a new listener for the checkLastOperationDate.skipped event +emitter.on('checkLastOperationDate.skipped', ({ dateFilePath, date }) => { + log('checkLastOperationDate.skipped', `Skipped last operation date - Date: ${date}`); +});