check_hosts_refresh.js 348 B

1234567891011121314151617181920
  1. /**
  2. * @author oldj
  3. * @blog https://oldj.net
  4. */
  5. 'use strict'
  6. import Agent from '../Agent'
  7. module.exports = (app, hosts) => {
  8. let list = app.state.list
  9. Agent.pact('checkNeedRemoteRefresh', list, hosts)
  10. .then(list => {
  11. if (!list) return
  12. Agent.emit('list_updated', list)
  13. })
  14. .catch(e => {
  15. console.log(e)
  16. })
  17. }