|
@@ -45,6 +45,13 @@ const ClsiManager = {
|
|
|
{ ...options, syncType: 'full' },
|
|
{ ...options, syncType: 'full' },
|
|
|
callback
|
|
callback
|
|
|
)
|
|
)
|
|
|
|
|
+ } else if (status === 'unavailable') {
|
|
|
|
|
+ return ClsiManager.sendRequestOnce(
|
|
|
|
|
+ projectId,
|
|
|
|
|
+ userId,
|
|
|
|
|
+ { ...options, syncType: 'full', forceNewClsiServer: true },
|
|
|
|
|
+ callback
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
callback(null, status, ...result)
|
|
callback(null, status, ...result)
|
|
|
}
|
|
}
|
|
@@ -173,6 +180,22 @@ const ClsiManager = {
|
|
|
if (options == null) {
|
|
if (options == null) {
|
|
|
options = {}
|
|
options = {}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (options.forceNewClsiServer) {
|
|
|
|
|
+ // Clear clsi cookie, then try again
|
|
|
|
|
+ return ClsiCookieManager.clearServerId(projectId, err => {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ return callback(err)
|
|
|
|
|
+ }
|
|
|
|
|
+ options.forceNewClsiServer = false // backend has now been reset
|
|
|
|
|
+ return ClsiManager._sendBuiltRequest(
|
|
|
|
|
+ projectId,
|
|
|
|
|
+ userId,
|
|
|
|
|
+ req,
|
|
|
|
|
+ options,
|
|
|
|
|
+ callback
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
ClsiFormatChecker.checkRecoursesForProblems(
|
|
ClsiFormatChecker.checkRecoursesForProblems(
|
|
|
req.compile != null ? req.compile.resources : undefined,
|
|
req.compile != null ? req.compile.resources : undefined,
|
|
|
(err, validationProblems) => {
|
|
(err, validationProblems) => {
|
|
@@ -434,6 +457,8 @@ const ClsiManager = {
|
|
|
callback(null, { compile: { status: 'conflict' } })
|
|
callback(null, { compile: { status: 'conflict' } })
|
|
|
} else if (response.statusCode === 423) {
|
|
} else if (response.statusCode === 423) {
|
|
|
callback(null, { compile: { status: 'compile-in-progress' } })
|
|
callback(null, { compile: { status: 'compile-in-progress' } })
|
|
|
|
|
+ } else if (response.statusCode === 503) {
|
|
|
|
|
+ callback(null, { compile: { status: 'unavailable' } })
|
|
|
} else {
|
|
} else {
|
|
|
callback(
|
|
callback(
|
|
|
new OError({
|
|
new OError({
|