mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-13 05:07:43 +02:00
UBERF-7532: Bulk operations for triggers (#6023)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -442,10 +442,8 @@
|
||||
|
||||
// TODO: We need a measure client and mark all operations with it as measure under one root,
|
||||
// to prevent other operations to infer our measurement.
|
||||
const doneOp = await getClient().measure('tracker.createIssue')
|
||||
|
||||
try {
|
||||
const operations = client.apply(_id)
|
||||
const operations = client.apply(_id, 'tracker.createIssue')
|
||||
|
||||
const lastOne = await client.findOne<Issue>(
|
||||
tracker.class.Issue,
|
||||
@@ -533,7 +531,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
await operations.commit()
|
||||
const result = await operations.commit()
|
||||
await descriptionBox?.createAttachments(_id)
|
||||
|
||||
const parents: IssueParentInfo[] =
|
||||
@@ -565,15 +563,12 @@
|
||||
descriptionBox?.removeDraft(false)
|
||||
isAssigneeTouched = false
|
||||
const d1 = Date.now()
|
||||
void doneOp().then((res) => {
|
||||
console.log('createIssue measure', res, Date.now() - d1)
|
||||
})
|
||||
console.log('createIssue measure', result, Date.now() - d1)
|
||||
} catch (err: any) {
|
||||
resetObject()
|
||||
draftController.remove()
|
||||
descriptionBox?.removeDraft(false)
|
||||
console.error(err)
|
||||
await doneOp() // Complete in case of error
|
||||
Analytics.handleError(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
await ops.createDoc(tracker.class.Project, core.space.Space, { ...projectData, type: typeId }, projectId)
|
||||
const succeeded = await ops.commit()
|
||||
|
||||
if (succeeded) {
|
||||
if (succeeded.result) {
|
||||
// Add space type's mixin with roles assignments
|
||||
await client.createMixin(
|
||||
projectId,
|
||||
|
||||
Reference in New Issue
Block a user