default file name

This commit is contained in:
Thomas Hobson 2021-04-23 13:09:33 +12:00
parent f683dfc2cf
commit 9c42254b80
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
2 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,11 @@ class Job {
constructor({ runtime, files, args, stdin, timeouts, alias }) {
this.uuid = uuidv4();
this.runtime = runtime;
this.files = files;
this.files = files.map((file,i) => ({
name: file.name || `file${i}`,
content: file.content
}));
this.args = args;
this.stdin = stdin;
this.timeouts = timeouts;
@ -35,6 +39,7 @@ class Job {
uid %= (config.runner_uid_max - config.runner_uid_min) + 1;
gid %= (config.runner_gid_max - config.runner_gid_min) + 1;
this.state = job_states.READY;
this.dir = path.join(config.data_directory, globals.data_directories.jobs, this.uuid);
}

View File

@ -15,11 +15,6 @@ module.exports = {
// isSemVer requires it to be a version, not a selector
body('files')
.isArray(),
body('files.*.name')
.isString()
.bail()
.not()
.contains('/'),
body('files.*.content')
.isString(),
],