Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Error when defining custom methods in Tasks and Workflows #29

Closed
geomagilles opened this issue May 20, 2019 · 0 comments · Fixed by #30
Closed

Error when defining custom methods in Tasks and Workflows #29

geomagilles opened this issue May 20, 2019 · 0 comments · Fixed by #30
Assignees
Labels

Comments

@geomagilles
Copy link
Contributor

geomagilles commented May 20, 2019

the following code

const { Task } = require("zenaton");

module.exports = Task("TaskA", {
  handle: async function() {
    console.log("Task A starts");

    await this.test(0);

    console.log("Task A ends");
    return 0;
  },
  test: async function(a) {
    if (0 <= a) {
      console.log("1");
    } else {
      console.log("2");
    }
  }
});

returns an error Error: "test" is defined more than once in "TaskA" task. Same with workflows.

It should work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants