Skip to content

Any way to send response to an api on flush event function complete #258

@sudhiryadav

Description

@sudhiryadav

I am trying to refresh cache from an api like the below method:

function refreshCache(req, res, next) {
    appCache.flushAll();
    res.status(200).send('Cache cleared');
}

The flush event below is called; however I would like to send the response after the tasks are done but no way to find the response object here:

appCache.on("flush", function () {
    reloadCache(); // <-- This is some promise and i want to send response after that.
    log.console.info('App Cache: flushed. Going to reload cache');
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions