Title: Any way to send response to an api on flush event function complete · Issue #258 · node-cache/node-cache · GitHub
Open Graph Title: Any way to send response to an api on flush event function complete · Issue #258 · node-cache/node-cache
X Title: Any way to send response to an api on flush event function complete · Issue #258 · node-cache/node-cache
Description: 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 respo...
Open Graph Description: 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...
X Description: 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 i...
Opengraph URL: https://github.com/node-cache/node-cache/issues/258
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Any way to send response to an api on flush event function complete","articleBody":"I am trying to refresh cache from an api like the below method:\r\n\r\n```javascript\r\nfunction refreshCache(req, res, next) {\r\n appCache.flushAll();\r\n res.status(200).send('Cache cleared');\r\n}\r\n```\r\n\r\nThe 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:\r\n\r\n```javascript\r\nappCache.on(\"flush\", function () {\r\n reloadCache(); // \u003c-- This is some promise and i want to send response after that.\r\n log.console.info('App Cache: flushed. Going to reload cache');\r\n});\r\n```","author":{"url":"https://github.com/sudhiryadav","@type":"Person","name":"sudhiryadav"},"datePublished":"2021-09-25T15:20:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/258/node-cache/issues/258"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d1ada722-333f-acfe-f2be-041581220df4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D19E:6F78D:3DAC8C9:52D12BE:6964C8E6 |
| html-safe-nonce | 9e0e08f1865f18d302965a81f0de204aad10016395a7170b11709df81e2a108b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTlFOjZGNzhEOjNEQUM4Qzk6NTJEMTJCRTo2OTY0QzhFNiIsInZpc2l0b3JfaWQiOiI0NjMwNjg1NTYzOTQzNzAwNzEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5a3b4149ae90c684c718353eb8b705926ca5e4deef5bed21d8ee53e4484a5a0d |
| hovercard-subject-tag | issue:1007113852 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/node-cache/node-cache/258/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a6a25e05867c7a2a0082618ea77f8723a065ab64f7fedfb2070db62a47300b26/node-cache/node-cache/issues/258 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a6a25e05867c7a2a0082618ea77f8723a065ab64f7fedfb2070db62a47300b26/node-cache/node-cache/issues/258 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sudhiryadav |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5838582163a1256e5ebd5086b7e1dc5cea93d82086c9c8b1395fb50f6ddab28d |
| turbo-cache-control | no-preview |
| go-import | github.com/node-cache/node-cache git https://github.com/node-cache/node-cache.git |
| octolytics-dimension-user_id | 54621913 |
| octolytics-dimension-user_login | node-cache |
| octolytics-dimension-repository_id | 2599450 |
| octolytics-dimension-repository_nwo | node-cache/node-cache |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2599450 |
| octolytics-dimension-repository_network_root_nwo | node-cache/node-cache |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8f997e7f84bd1db9537ba403fa68be0da3423594 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width