Skip to content

Commit

Permalink
fix: swap from pool.runTask() to pool.run()
Browse files Browse the repository at this point in the history
  • Loading branch information
darkgl0w committed Dec 5, 2021
1 parent 5e47427 commit c5ebb09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface FastifyPiscinaPool extends Piscina {}
declare module "fastify" {
interface FastifyInstance {
piscina: FastifyPiscinaPool;
runTask: FastifyPiscinaPool['runTask'];
runTask: FastifyPiscinaPool['run'];
}
}

Expand Down
4 changes: 3 additions & 1 deletion plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ const { name, version } = require('./package.json');

function piscinaPlugin (fastify, options, next) {
const pool = new Piscina(options);

fastify.decorate('piscina', pool);
fastify.decorate('runTask', (...args) => pool.runTask(...args));
fastify.decorate('runTask', (...args) => pool.run(...args));

next();
}

Expand Down

0 comments on commit c5ebb09

Please sign in to comment.