فهرست منبع

use syncType and syncState for clsi state options

Brian Gough 9 سال پیش
والد
کامیت
5c02255e07
1فایلهای تغییر یافته به همراه8 افزوده شده و 6 حذف شده
  1. 8 6
      services/web/app/coffee/Features/Compile/ClsiManager.coffee

+ 8 - 6
services/web/app/coffee/Features/Compile/ClsiManager.coffee

@@ -20,7 +20,7 @@ module.exports = ClsiManager =
 		ClsiManager.sendRequestOnce project_id, user_id, _.clone(options), (error, status, result...) ->
 		ClsiManager.sendRequestOnce project_id, user_id, _.clone(options), (error, status, result...) ->
 			return callback(error) if error?
 			return callback(error) if error?
 			if status is 'conflict'
 			if status is 'conflict'
-				options.state = "conflict" # will force full compile
+				options.syncType = "full" #  force full compile
 				ClsiManager.sendRequestOnce project_id, user_id, options, callback # try again
 				ClsiManager.sendRequestOnce project_id, user_id, options, callback # try again
 			else
 			else
 				callback(error, status, result...)
 				callback(error, status, result...)
@@ -126,7 +126,7 @@ module.exports = ClsiManager =
 			ClsiStateManager.checkProjectStateMatch project_id, project, (error, stateOk, projectState) ->
 			ClsiStateManager.checkProjectStateMatch project_id, project, (error, stateOk, projectState) ->
 				return callback(error) if error?
 				return callback(error) if error?
 				logger.log project_id: project_id, checkState: stateOk, "checked project state"
 				logger.log project_id: project_id, checkState: stateOk, "checked project state"
-				if stateOk and not options.state? # incremental
+				if stateOk and options.syncType isnt "full" # incremental
 					ClsiManager._getContentFromDocUpdater project_id, (error, docUpdaterDocs) ->
 					ClsiManager._getContentFromDocUpdater project_id, (error, docUpdaterDocs) ->
 						return callback(error) if error?
 						return callback(error) if error?
 						# make this incremental
 						# make this incremental
@@ -136,7 +136,8 @@ module.exports = ClsiManager =
 							for doc in docUpdaterDocs or []
 							for doc in docUpdaterDocs or []
 								path = docPath[doc._id]
 								path = docPath[doc._id]
 								docs[path] = doc
 								docs[path] = doc
-							options.incremental = projectState
+							options.syncType = "incremental"
+							options.syncState = projectState
 							ClsiManager._finaliseRequest project_id, options, project, docs, [], callback
 							ClsiManager._finaliseRequest project_id, options, project, docs, [], callback
 				else
 				else
 					ClsiManager._getContentFromMongo project_id, (error, docs, files) ->
 					ClsiManager._getContentFromMongo project_id, (error, docs, files) ->
@@ -147,7 +148,8 @@ module.exports = ClsiManager =
 							if error?
 							if error?
 								logger.err err:error, project_id:project_id, "error storing state in redis"
 								logger.err err:error, project_id:project_id, "error storing state in redis"
 								#return callback(error)
 								#return callback(error)
-							options.state = projectState
+							options.syncType = "full"
+							options.syncState = projectState
 							ClsiManager._finaliseRequest project_id, options, project, docs, files, callback
 							ClsiManager._finaliseRequest project_id, options, project, docs, files, callback
 
 
 	_getContentFromDocUpdater: (project_id, callback = (error, docs) ->) ->
 	_getContentFromDocUpdater: (project_id, callback = (error, docs) ->) ->
@@ -200,8 +202,8 @@ module.exports = ClsiManager =
 					imageName: project.imageName
 					imageName: project.imageName
 					draft: !!options.draft
 					draft: !!options.draft
 					check: options.check
 					check: options.check
-					incremental: options.incremental
-					state: options.state
+					syncType: options.syncType
+					syncState: options.syncState
 				rootResourcePath: rootResourcePath
 				rootResourcePath: rootResourcePath
 				resources: resources
 				resources: resources
 		}
 		}