Created
July 19, 2018 07:03
-
-
Save DimaDaxDadeco/24be095bfeec1d19047bdb2448fad67c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: | |
async getJobSchedule({ augurCode, jobType }) { | |
const readFileAsync = Promise.promisify(fs.readFile); | |
const filePath = path.resolve(`${__dirname}/../etc/cron.d/${augurCode}_${jobType}.conf`); | |
const contents = await readFileAsync(filePath, 'utf8'); | |
console.log('blaaa', filePath, contents); | |
return {}; | |
} | |
Route Method: | |
export function* getJobSchedule() { | |
this.body = yield schedules | |
.getJobSchedule({ | |
augurCode: this.params.augurCode, | |
jobType: this.params.jobType, | |
}) | |
.catch(handleError.bind(this)); | |
} | |
router.get('/api/schedule/:augurCode/:jobType', authorized(), scheduling.getJobSchedule); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment