flush_all.js 532 B

12345678910111213141516171819202122232425
  1. const UpdatesManager = require('../app/js/UpdatesManager')
  2. async function main() {
  3. return new Promise((resolve, reject) => {
  4. const limit = -1
  5. console.log('Flushing all updates')
  6. UpdatesManager.flushAll(limit, err => {
  7. if (err) {
  8. reject(err)
  9. } else {
  10. resolve()
  11. }
  12. })
  13. })
  14. }
  15. main()
  16. .then(() => {
  17. console.log('Done flushing all updates')
  18. process.exit(0)
  19. })
  20. .catch(error => {
  21. console.error('There was an error flushing updates', { error })
  22. process.exit(1)
  23. })