Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
e0c87429
Commit
e0c87429
authored
5 years ago
by
Vivek Naik
Browse files
Options
Downloads
Patches
Plain Diff
use of existing row id
parent
be800ea9
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!134
Mep release271219
,
!133
Add: Asset FDB and merged bucket type
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dalmdl/corefdb/bucket.go
+9
-3
dalmdl/corefdb/bucket.go
with
9 additions
and
3 deletions
dalmdl/corefdb/bucket.go
+
9
−
3
View file @
e0c87429
...
...
@@ -551,12 +551,18 @@ func SaveMediaInFDB(dbName string, indexID string, mediaData []byte, rs *gjson.R
loggermdl
.
LogError
(
err
)
return
recordPath
,
err
}
rowID
:=
guidmdl
.
GetGUID
()
json
,
_
=
sjson
.
Set
(
json
,
"rowID"
,
rowID
)
rowID
:=
""
// path = path + ".json"
err
=
index
.
indexObj
.
Update
(
func
(
tx
*
buntdb
.
Tx
)
error
{
// optimization : if data not changed then dont update
_
,
_
,
err
:=
tx
.
Set
(
path
,
json
,
nil
)
prevVal
,
err
:=
tx
.
Get
(
path
,
false
)
rowID
=
gjson
.
Parse
(
prevVal
)
.
Get
(
"rowID"
)
.
String
()
if
rowID
==
""
{
rowID
=
guidmdl
.
GetGUID
()
}
json
,
_
=
sjson
.
Set
(
json
,
"rowID"
,
rowID
)
_
,
_
,
err
=
tx
.
Set
(
path
,
json
,
nil
)
if
err
!=
nil
{
loggermdl
.
LogError
(
err
)
return
err
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets