Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Update ponos to v 5#110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Update ponos to v 5 #110
Changes from all commits
2257fa18113d615ae75edc19452e041548ced5ff4a768f4da08f279b1fc2bdf3274a062133a07cc915242f27c082d5c67674c743025767823ad89a8d999533464f9c6a1702b2File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,8 +3,18 @@ | ||
| * @module lib/models/rabbitmq | ||
| */ | ||
| 'use strict' | ||
| const joi = require('joi') | ||
| const RabbitMQ = require('ponos/lib/rabbitmq') | ||
| function generateJobDefs (tasks) { | ||
| return tasks.map(function (task) { | ||
| return { | ||
| name: task, | ||
| jobSchema: joi.object({}).unknown() | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to not define these
| ||
| } | ||
| }) | ||
| } | ||
| /** | ||
| * Rabbitmq internal singelton instance. | ||
| * @type {rabbitmq} | ||
| @@ -15,37 +25,37 @@ const publisher = new RabbitMQ({ | ||
| port: process.env.RABBITMQ_PORT, | ||
| username: process.env.RABBITMQ_USERNAME, | ||
| password: process.env.RABBITMQ_PASSWORD, | ||
| events: [ | ||
| events: generateJobDefs([ | ||
| 'instance.container.health-check.failed', | ||
| 'instance.expired' | ||
| ], | ||
| tasks: [ | ||
| 'khronos:canary:build', | ||
| 'khronos:canary:failover', | ||
| 'khronos:canary:github-branch', | ||
| 'khronos:canary:log', | ||
| 'khronos:canary:network', | ||
| 'khronos:canary:network-ping', | ||
| 'khronos:containers:delete', | ||
| 'khronos:containers:image-builder:prune', | ||
| 'khronos:containers:image-builder:prune-dock', | ||
| 'khronos:containers:orphan:check-against-mongo', | ||
| 'khronos:containers:orphan:prune', | ||
| 'khronos:containers:orphan:prune-dock', | ||
| 'khronos:containers:remove', | ||
| 'khronos:context-versions:check-recent-usage', | ||
| 'khronos:context-versions:prune-expired', | ||
| 'khronos:context-versions:remove-and-protect-instances', | ||
| 'khronos:images:check-against-context-versions', | ||
| 'khronos:images:prune', | ||
| 'khronos:images:prune-dock', | ||
| 'khronos:images:remove', | ||
| 'khronos:instances:cleanup', | ||
| 'khronos:metrics:container-status', | ||
| 'khronos:metrics:report-org-container-status', | ||
| 'khronos:weave:prune', | ||
| 'khronos:weave:prune-dock' | ||
| ] | ||
| ]), | ||
| tasks: generateJobDefs([ | ||
| 'canary.build.run', | ||
| 'canary.failover.run', | ||
| 'canary.github-branch.run', | ||
| 'canary.log.run', | ||
| 'canary.network.run', | ||
| 'canary.network-ping.run', | ||
| 'containers.delete', | ||
| 'containers.image-builder.prune', | ||
| 'containers.image-builder.prune-dock', | ||
| 'containers.orphan.check-against-mongo', | ||
| 'containers.orphan.prune', | ||
| 'containers.orphan.prune-dock', | ||
| 'containers.remove', | ||
| 'context-versions.check-recent-usage', | ||
| 'context-versions.prune-expired', | ||
| 'context-versions.remove-and-protect-instances', | ||
| 'images.check-against-context-versions', | ||
| 'images.prune', | ||
| 'images.prune-dock', | ||
| 'images.remove', | ||
| 'instances.cleanup', | ||
| 'metrics.container-status', | ||
| 'metrics.report-org-container-status', | ||
| 'weave.prune', | ||
| 'weave.prune-dock' | ||
| ]) | ||
| }) | ||
| module.exports = publisher | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well not define this ... It's an optional argument
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe keep it? at least it will validate that job is an object