Comments (1)
Your DataController.insertIncidents has two parameters, req and res, right ?
But when you are calling the controller, you provide no arguments to it. So what do you expect to work here? You have an error in your code.
Furthermore, req
and res
are objects for HTTP requests and responses. You can't get these on cron.
Move your logic for incident insertion to a separate service layer and call it, instead of a controller.
Since this issue has nothing to do with a hook itself, I'm closing the issue.
from sails-hook-cron.
Related Issues (20)
- Cron syntax (schedule field) HOT 2
- start: true doesn't start job HOT 3
- Cron (month) issue HOT 1
- Non working example HOT 3
- Since today "npm i sails-hook-cron" installs an empty folder HOT 10
- How to run cron on multiple servers? HOT 1
- Cron running for every second HOT 3
- Cron scheduled dosen't run at all HOT 1
- Cron run twice or more based on the time the cron is saved HOT 2
- how to pass parram to onTick function HOT 1
- How to pass arguments in jobs and how to receive it? HOT 1
- cron jobs not running on digitalocean server. HOT 1
- Global Sails variable not avaliable within the onTick function HOT 1
- How to schedule a cron for every one hour? HOT 2
- sails.config.environment HOT 3
- local.js = bad instructions HOT 5
- contexr HOT 2
- Multi-server HOT 3
- How can I enable/disable the cron service? HOT 2
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 sails-hook-cron.