Создал функцию с использованием костра, но остановился с ошибкой - PullRequest
0 голосов
/ 08 октября 2018

Создана функция с костром, но я получаю сообщение об ошибке в журнале.Я хочу напечатать строку на консоли через 60 секунд.Вот почему я Костер.Я получил ссылку отсюда ... Я ссылался отсюда

The error is

Bonfire.Scheduler is not a constructor

Вот код

 let ref = admin.firestore().collection('UserData').doc(user_id).collection('subCollection').doc(id)

  // Pass the newly extracted reference to the Bonfire object. This object can
  // then be used as desired.
let  jobScheduler = Bonfire.Scheduler = new Bonfire.Scheduler(ref, (key = String, job = Bonfire.Job) => {
      // Process completed events here.
      console.log('Completed job with key: ' + key);
  })

let job = Bonfire.Job = new Bonfire.Job(
      // Setting the key is important, it serves as the key/id of the job, and
      // will help as an identification mechaism.
      'test_key',
      // The type helps you figure out how to handle the job and parse its
      // payload.
      'TYPE_SIMPLE_JOB',
      // Last but not least, set the time at which the job will be executed.
      // In this case, it will be executed 60 seconds from the current time.
      new Date(Date.now() + 60000)
  )


  jobScheduler.schedule(job);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...