Skip to content

Hubot Brain not loading? #1716

Discussion options

You must be logged in to vote

The answer!

We don't need a function for this step:

  robot.brain.on('loaded', data => {
    const jobStrings = robot.brain.get(datastoreKey) || {}
    robot.logger.debug(`Loaded jobs from brain: ${JSON.stringify(jobStrings)}`)
    let count = 0
    for (let key in jobStrings) {
      JOBS[key] = startJob(robot, key, ...Array.from(jobStrings[key]))
      robot.logger.debug(`Starting ${jobStrings[key]}`)
      count++
    }
    robot.logger.info(`Loaded ${count} jobs from brain...`)
  })

Now I'm actually successfully loading messages!

Thanks for the help @joeyguerra

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@johnseekins-pathccm
Comment options

@johnseekins-pathccm
Comment options

@johnseekins-pathccm
Comment options

@joeyguerra
Comment options

Comment options

You must be logged in to vote
1 reply
@joeyguerra
Comment options

Answer selected by johnseekins-pathccm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants