Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dunixir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
teaching
dunixir
Merge requests
!42
Resolve "Récupération des blocs"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Récupération des blocs"
186-recuperation-des-blocs
into
dev
Overview
0
Commits
9
Pipelines
10
Changes
1
Merged
JAUJAY Augustin
requested to merge
186-recuperation-des-blocs
into
dev
3 years ago
Overview
0
Commits
9
Pipelines
10
Changes
1
Expand
Closes
#186 (closed)
Edited
3 years ago
by
JAUJAY Augustin
0
0
Merge request reports
Viewing commit
800b7f76
Prev
Next
Show latest version
1 file
+
1
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
800b7f76
Best way to get last block in DB
· 800b7f76
Augustin Jaujay
authored
3 years ago
lib/dunixir/create_bdd.ex
+
1
−
7
Options
@@ -45,13 +45,7 @@ defmodule BDD do
_
->
Logger
.
info
(
'Filling DB : Failing when getting current block'
)
end
# Getting current block in local database
lastLocalBlock
=
case
:dets
.
first
(
:block
)
do
:"$end_of_table"
->
0
n
->
n
end
lastLocalBlock
..
50
# currentBlock["number"]
:dets
.
info
(
:block
)[
:size
]
..
50
# currentBlock["number"] # TODO : Fetch all the blocks
|>
Enum
.
chunk_every
(
5000
)
|>
Enum
.
map
(
fn
chk
->
# Putting the new blocks in the local database
Loading