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: patch-diff.githubusercontent.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:5364a6da-7b96-1b0d-b8ab-6f7c45c9fa2d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D80A:2C24EC:374AC42:4CAA1A0:6977CE73 |
| html-safe-nonce | bf546e7b97d8e168f338a8aec39c3c6fa4abaaae2fc4fce5b72082c8fc6aae43 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODBBOjJDMjRFQzozNzRBQzQyOjRDQUExQTA6Njk3N0NFNzMiLCJ2aXNpdG9yX2lkIjoiNDQwODQzMzQxNDUzNzQ2NTQ1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 55bd0615446f1378a256ddbad271c5c45781637b12bf12379096a3f07a8fd7b9 |
| 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 | 173f8c2eae2e017de550dd28a9ea88ad5c1e52c70df7ea05bcd820330b3b2fec |
| 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 | 7b19554cad55a536fac18eeedb416dd87c37b1f5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width