Merge branch 'master' into sprites
This commit is contained in:
@@ -29,8 +29,6 @@ module.exports = CompileController =
|
||||
options.compiler = req.body.compiler
|
||||
if req.body?.draft
|
||||
options.draft = req.body.draft
|
||||
if req.query?.isolated is "true"
|
||||
options.isolated = true
|
||||
logger.log {options:options, project_id:project_id, user_id:user_id}, "got compile request"
|
||||
CompileManager.compile project_id, user_id, options, (error, status, outputFiles, clsiServerId, limits, validationProblems) ->
|
||||
return next(error) if error?
|
||||
@@ -44,17 +42,15 @@ module.exports = CompileController =
|
||||
}
|
||||
|
||||
_compileAsUser: (req, callback) ->
|
||||
# callback with user_id if isolated flag is set on request, undefined otherwise
|
||||
isolated = req.query?.isolated is "true"
|
||||
if isolated
|
||||
# callback with user_id if per-user, undefined otherwise
|
||||
if not Settings.disablePerUserCompiles
|
||||
AuthenticationController.getLoggedInUserId req, callback # -> (error, user_id)
|
||||
else
|
||||
callback() # do a per-project compile, not per-user
|
||||
|
||||
_downloadAsUser: (req, callback) ->
|
||||
# callback with user_id if isolated flag or user_id param is set on request, undefined otherwise
|
||||
isolated = req.query?.isolated is "true" or req.params.user_id?
|
||||
if isolated
|
||||
# callback with user_id if per-user, undefined otherwise
|
||||
if not Settings.disablePerUserCompiles
|
||||
AuthenticationController.getLoggedInUserId req, callback # -> (error, user_id)
|
||||
else
|
||||
callback() # do a per-project compile, not per-user
|
||||
|
||||
@@ -38,7 +38,7 @@ module.exports = CompileManager =
|
||||
for key, value of limits
|
||||
options[key] = value
|
||||
# only pass user_id down to clsi if this is a per-user compile
|
||||
compileAsUser = if options.isolated then user_id else undefined
|
||||
compileAsUser = if Settings.disablePerUserCompiles then undefined else user_id
|
||||
ClsiManager.sendRequest project_id, compileAsUser, options, (error, status, outputFiles, clsiServerId, validationProblems) ->
|
||||
return callback(error) if error?
|
||||
logger.log files: outputFiles, "output files"
|
||||
|
||||
Reference in New Issue
Block a user