Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
timothe
duniter
Commits
c9384483
Commit
c9384483
authored
Nov 17, 2018
by
Cédric Moreau
Browse files
[fix] Sync fail with chained transactions
parent
0ab1700b
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts
View file @
c9384483
...
...
@@ -365,14 +365,16 @@ export class GlobalIndexStream extends Duplex {
}
@
MonitorExecutionTime
()
private
async
blockFillTxSourcesConditions
(
local_sindex
:
any
[]
|
SindexEntry
[])
{
private
async
blockFillTxSourcesConditions
(
local_sindex
:
SindexEntry
[])
{
// Fills in correctly the SINDEX
await
Promise
.
all
(
Underscore
.
where
(
local_sindex
,
{
op
:
'
UPDATE
'
}).
map
(
async
entry
=>
{
if
(
!
entry
.
conditions
)
{
if
(
entry
.
srcType
===
'
D
'
)
{
entry
.
conditions
=
'
SIG(
'
+
entry
.
identifier
+
'
)
'
}
else
{
const
src
=
(
await
this
.
dal
.
getSource
(
entry
.
identifier
,
entry
.
pos
,
false
))
as
FullSindexEntry
// First: have a look locally, but only chained transactions would have `localSrc` matching (giving conditions)
const
localSrc
=
local_sindex
.
filter
(
s
=>
s
.
identifier
===
entry
.
identifier
&&
s
.
pos
===
entry
.
pos
&&
s
.
conditions
)[
0
]
const
src
=
localSrc
||
(
await
this
.
dal
.
getSource
(
entry
.
identifier
,
entry
.
pos
,
false
))
as
FullSindexEntry
entry
.
conditions
=
src
.
conditions
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment