Skip to content
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

feat: tasks execution log #13

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/entity/job/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ function BaseSchema (props) {
dtask.approvers = data.task.approvers
dtask.task_arguments = data.task.task_arguments
dtask.output_parameters = data.task.output_parameters
dtask.execution_logging_enabled = data.task.execution_logging_enabled

if (data.task.execution_logging_enabled) {
if (!data.task.execution_logging_basename) {
dtask.execution_logging_basename = data.task._id.toString()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dtask.execution_logging_basename = data.task._id.toString()
dtask.execution_logging_basename = `${data.task._id.toString()}.log`

}
dtask.execution_logging_dirname = data.task.execution_logging_dirname || null
}

data.task = dtask
}
}
Expand Down
4 changes: 3 additions & 1 deletion core/entity/job/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const ScriptSchema = new BaseSchema({
script: { type: Object }, // this is embedded, not a reference
env: { type: Object, default: () => { return {} }},
timeout: { type: Number },
logging: { type: Boolean, default: false }
execution_logging_enabled: { type: Boolean, default: false },
execution_logging_basename: { type: String, default: null },
execution_logging_dirname: { type: String, default: null },
})

module.exports = ScriptSchema
4 changes: 3 additions & 1 deletion core/entity/task/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const ScriptSchema = new BaseSchema({
script_arguments: { type: Array }, // will be replaced with task_arguments in the future
script: { type: ObjectId, ref: 'Script' },
env: { type: Object, default: () => { return {} }},
logging: { type: Boolean, default: false }
execution_logging_enabled: { type: Boolean, default: false },
execution_logging_basename: { type: String, default: null },
execution_logging_dirname: { type: String, default: null },
})

module.exports = ScriptSchema
Expand Down