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
befd29cf
Commit
befd29cf
authored
5 years ago
by
Vivek Naik
Browse files
Options
Downloads
Patches
Plain Diff
modify: row id generation logic change
parent
9be72851
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
+10
-5
dalmdl/corefdb/bucket.go
with
10 additions
and
5 deletions
dalmdl/corefdb/bucket.go
+
10
−
5
View file @
befd29cf
...
@@ -553,15 +553,20 @@ func SaveMediaInFDB(dbName string, indexID string, mediaData []byte, rs *gjson.R
...
@@ -553,15 +553,20 @@ func SaveMediaInFDB(dbName string, indexID string, mediaData []byte, rs *gjson.R
return
recordPath
,
err
return
recordPath
,
err
}
}
rowID
:=
""
rowID
:=
""
if
index
.
IsDynamicName
{
rowID
=
rs
.
Get
(
index
.
IndexNameQuery
)
.
String
()
}
else
{
rowID
=
index
.
IndexNameQuery
}
// path = path + ".json"
// path = path + ".json"
err
=
index
.
indexObj
.
Update
(
func
(
tx
*
buntdb
.
Tx
)
error
{
err
=
index
.
indexObj
.
Update
(
func
(
tx
*
buntdb
.
Tx
)
error
{
// optimization : if data not changed then dont update
// optimization : if data not changed then dont update
prevVal
,
err
:=
tx
.
Get
(
path
,
false
)
//
prevVal, err := tx.Get(path, false)
rowID
=
gjson
.
Parse
(
prevVal
)
.
Get
(
"rowID"
)
.
String
()
//
rowID = gjson.Parse(prevVal).Get("rowID").String()
if
rowID
==
""
{
//
if rowID == "" {
rowID
=
guidmdl
.
GetGUID
()
//
rowID = guidmdl.GetGUID()
}
//
}
json
,
_
=
sjson
.
Set
(
json
,
"rowID"
,
rowID
)
json
,
_
=
sjson
.
Set
(
json
,
"rowID"
,
rowID
)
_
,
_
,
err
=
tx
.
Set
(
path
,
json
,
nil
)
_
,
_
,
err
=
tx
.
Set
(
path
,
json
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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