219 concurrent operations prohibited
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
//variables.framework.docs={};
|
//variables.framework.docs={};
|
||||||
variables.framework.docs.APIName="svc-api";
|
variables.framework.docs.APIName="svc-api";
|
||||||
variables.framework.docs.APIVersion="0.218"; /*$ git config --global --unset user.password*/
|
variables.framework.docs.APIVersion="0.219"; /*$ git config --global --unset user.password*/
|
||||||
|
|
||||||
variables.framework.globalHeaders = structNew();
|
variables.framework.globalHeaders = structNew();
|
||||||
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
||||||
|
|||||||
@@ -164,9 +164,6 @@
|
|||||||
<m:field>iop.note</m:field>
|
<m:field>iop.note</m:field>
|
||||||
<m:field>sop.config::text as config</m:field>
|
<m:field>sop.config::text as config</m:field>
|
||||||
<m:field>null as nested_ref_data</m:field><!--- placeholder for future data --->
|
<m:field>null as nested_ref_data</m:field><!--- placeholder for future data --->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<m:field formatter=#request.castToBool#>sop.is_sensitive</m:field>
|
<m:field formatter=#request.castToBool#>sop.is_sensitive</m:field>
|
||||||
</m:field_set>
|
</m:field_set>
|
||||||
from svc_operation_cfs_param sop
|
from svc_operation_cfs_param sop
|
||||||
|
|||||||
@@ -43,11 +43,17 @@
|
|||||||
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid('guid',arguments.instanceOperationUid)#/>
|
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid('guid',arguments.instanceOperationUid)#/>
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
|
<cfquery name="local.qInstance" result="local.result">
|
||||||
|
select io.instance_uid
|
||||||
|
from instance_operation io
|
||||||
|
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid('guid',arguments.instanceOperationUid)#/>
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
<!--- Check operation status, do not start already started (*** consider timeout and cancelling timed out operations here) --->
|
<!--- Check operation status, do not start already started (*** consider timeout and cancelling timed out operations here) --->
|
||||||
<cfquery name="local.qCheckStarted" result="local.result">
|
<cfquery name="local.qCheckStarted" result="local.result">
|
||||||
select io.dt_submit, io.dt_finish, io.dt_start, io.submit_result, io.status_url
|
select io.dt_submit, io.dt_finish, io.dt_start, io.submit_result, io.status_url
|
||||||
from instance_operation io
|
from instance_operation io
|
||||||
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid('guid',arguments.instanceOperationUid)#/>
|
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#local.qInstance.instance_uid#" null=#!isValid('guid',local.qInstance.instance_uid)#/>
|
||||||
</cfquery> <!--- <cfdump var=#local.qCheckStarted.dt_finish#/><cfabort/> --->
|
</cfquery> <!--- <cfdump var=#local.qCheckStarted.dt_finish#/><cfabort/> --->
|
||||||
|
|
||||||
<!---
|
<!---
|
||||||
@@ -57,10 +63,17 @@
|
|||||||
Возможно, эту логику нужно воспроизвести на фронте
|
Возможно, эту логику нужно воспроизвести на фронте
|
||||||
--->
|
--->
|
||||||
<cfif local.qCheckStarted.recordCount EQ 0>
|
<cfif local.qCheckStarted.recordCount EQ 0>
|
||||||
<cfreturn representationOf(this.helper.formatMessage("There is no configured instance operation with uid #arguments.instanceOperationUid#","Instance operation not found")).withStatus(404)/>
|
<cfreturn representationOf(this.helper.formatMessage(
|
||||||
|
"There is no configured instance operation with uid #arguments.instanceOperationUid#",
|
||||||
|
"Instance operation not found")
|
||||||
|
).withStatus(404)/>
|
||||||
<cfelseif left(local.qCheckStarted.submit_result,1) EQ "2" AND len(local.qCheckStarted.dt_finish) EQ 0><!--- 201 etc --->
|
<cfelseif left(local.qCheckStarted.submit_result,1) EQ "2" AND len(local.qCheckStarted.dt_finish) EQ 0><!--- 201 etc --->
|
||||||
<cfif getJobStatus(local.qCheckStarted.status_url) NEQ 'FAILED'>
|
<cfset var jobStatus = getJobStatus(local.qCheckStarted.status_url)/>
|
||||||
<cfreturn representationOf(this.helper.formatMessage("Operation already started", "Parameter creation disabled for started operation")).withStatus(422)/>
|
<cfif jobStatus NEQ 'FAILED'>
|
||||||
|
<cfreturn representationOf(this.helper.formatMessage(
|
||||||
|
"There is a started operation on this instance",
|
||||||
|
"Concurrent operations are not supported (job status: #jobStatus#)")
|
||||||
|
).withStatus(422)/>
|
||||||
</cfif>
|
</cfif>
|
||||||
</cfif>
|
</cfif>
|
||||||
<!--- Check CFS parameters at least for existence
|
<!--- Check CFS parameters at least for existence
|
||||||
|
|||||||
Reference in New Issue
Block a user