Browse Source

Add event listeners for deleteOldFiles and checkLastOperationDate events, and log corresponding messages

node16
Onja 12 months ago
parent
commit
78f065db28
  1. 45
      src/subscribers/consoleSubscriber.js

45
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}`);
// });
// });
// 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}`);
});

Loading…
Cancel
Save