Skip to content

Instantly share code, notes, and snippets.

@herecydev
Created December 27, 2018 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herecydev/f6c9ee4a98b0535cf5491a21e0182102 to your computer and use it in GitHub Desktop.
Save herecydev/f6c9ee4a98b0535cf5491a21e0182102 to your computer and use it in GitHub Desktop.
basehandler.js
const taskHandler = async (task) => {
try {
const handler = await import(`handlers/${task.taskId}`);
return await handler.execute(task);
}
catch {
return -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment