Comments (5)
Fala @kennedyrs !
Isso mesmo, lança exceção que é a maneira de dizer que o serviço não deu certo!
from adonis-bull.
Outra dúvida, qual seria a melhor estratégia para acionar um job assim que a aplicação iniciar?
Bull.add(Job.key, { delay: 6000, attempts: 3, repeat: { cron: '0 */6 * * *' } })
from adonis-bull.
Cria um ServiceProvider com adonis make:provider SeuProvider
e roda chame ele no método *boot do provider.
Ah, tem que registrar o provider no array providers
do start/app.js
const path = require('path')
const providers = [
...
'@rocketseat/adonis-bull/providers/Bull',
path.join(__dirname, '..', 'providers', 'SeuProvider'),
]
from adonis-bull.
Hey @kennedyrs, this issue was closed because it was not following the guidelines described here.
While contributing or interacting in any way in this project, refrain from using any language other than English.
from adonis-bull.
Cria um ServiceProvider com
adonis make:provider SeuProvider
e roda chame ele no método *boot do provider.Ah, tem que registrar o provider no array
providers
dostart/app.js
const path = require('path') const providers = [ ... '@rocketseat/adonis-bull/providers/Bull', path.join(__dirname, '..', 'providers', 'SeuProvider'), ]
Estou tentanto fazer isto mas no Provider em que função corro os Bull.add()
? Tentei em register
, boot
mas não estou conseguindo importar o Bull do tipo const Bull = this.app.use('Rocketseat/Bull');
dá sempre Bull.add is not a function
.
Exemplo:
boot() {
const Bull = this.app.use('Rocketseat/Bull');
const Job = this.app.use('App/Jobs/Job');
Bull.add(Job.key, { attempts: 3, repeat: { cron: '0 0 * * *' } });
}
from adonis-bull.
Related Issues (20)
- How to test jobs with Japa?
- No context in bull exceptions handler like in default one.
- Support for addBulk
- Properties names in job are with underscores
- Support AdonisJS 5?
- BullMQ connection options deprecation
- keyPrefix issue no data passed, Error: Missing lock for job (v5) HOT 1
- How can we keep the data persistent when server goes down
- How to protect the bull board behind a login form?
- Conflicting readme and description - is this library ready for Adonis v5 or not?
- v5 job file malformed HOT 1
- Is this project officially out of support? HOT 3
- Remove repeatable jobs HOT 2
- Adonis v6 HOT 1
- What is the recommended setup for multiple workers?
- Cannot read property 'bull' of undefined HOT 1
- General improvements (v5)
- how do i schedule a task to repeat every 1st of the month or choose the day? HOT 1
- Adonis v5 Key Prefix HOT 2
- Dúvida sobre o Bull HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adonis-bull.