You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
636 B

  1. require('../core/worker')
  2. /* global WIKI */
  3. module.exports = async (job) => {
  4. WIKI.logger.info(`Syncing with storage provider ${job.data.target.title}...`)
  5. try {
  6. const target = require(`../modules/storage/${job.data.target.key}/storage.js`)
  7. target[job.data.event].call({
  8. config: job.data.target.config,
  9. mode: job.data.target.mode,
  10. page: job.data.page
  11. })
  12. WIKI.logger.info(`Syncing with storage provider ${job.data.target.title}: [ COMPLETED ]`)
  13. } catch (err) {
  14. WIKI.logger.error(`Syncing with storage provider ${job.data.target.title}: [ FAILED ]`)
  15. WIKI.logger.error(err.message)
  16. }
  17. }