Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
16
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
cellframe
cellframe-sdk
Commits
80b132d2
Commit
80b132d2
authored
8 months ago
by
roderick
Browse files
Options
Downloads
Patches
Plain Diff
[*]fix notify
parent
aaaaf01e
No related branches found
Branches containing commit
No related tags found
1 merge request
!1693
Bugfix 11834
Pipeline
#41251
passed with stage
in 12 minutes and 52 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dap-sdk
+1
-1
1 addition, 1 deletion
dap-sdk
modules/chain/dap_chain.c
+5
-5
5 additions, 5 deletions
modules/chain/dap_chain.c
modules/chain/dap_chain_cell.c
+2
-2
2 additions, 2 deletions
modules/chain/dap_chain_cell.c
modules/chain/include/dap_chain.h
+1
-1
1 addition, 1 deletion
modules/chain/include/dap_chain.h
with
9 additions
and
9 deletions
dap-sdk
@
85b0a265
Compare
1b6f4c30
...
85b0a265
Subproject commit
1b6f4c30a80d1c8ccfdc9a9b4f283caf3073f0ee
Subproject commit
85b0a265180fc0d3a4d34ba6c7f3b5fee82f173d
This diff is collapsed.
Click to expand it.
modules/chain/dap_chain.c
+
5
−
5
View file @
80b132d2
...
...
@@ -582,15 +582,15 @@ int dap_chain_save_all(dap_chain_t *l_chain)
return
l_ret
;
}
//send chain
downloading
data to notify socket
//send chain
load_progress
data to notify socket
bool
download_notify_callback
(
dap_chain_t
*
a_chain
)
{
json_object
*
l_chain_info
=
json_object_new_object
();
json_object_object_add
(
l_chain_info
,
"net_id"
,
json_object_new_uint64
(
a_chain
->
net_id
.
uint64
));
json_object_object_add
(
l_chain_info
,
"class"
,
json_object_new_string
(
"chain_init"
));
json_object_object_add
(
l_chain_info
,
"net"
,
json_object_new_string
(
a_chain
->
net_name
));
json_object_object_add
(
l_chain_info
,
"chain_id"
,
json_object_new_uint64
(
a_chain
->
id
.
uint64
));
json_object_object_add
(
l_chain_info
,
"cell_id"
,
json_object_new_uint64
(
a_chain
->
active_cell_id
.
uint64
));
json_object_object_add
(
l_chain_info
,
"download_percentage"
,
json_object_new_int
(
a_chain
->
download_percentage
));
json_object_object_add
(
l_chain_info
,
"load_progress"
,
json_object_new_int
(
a_chain
->
load_progress
));
dap_notify_server_send_mt
(
json_object_get_string
(
l_chain_info
));
log_it
(
L_DEBUG
,
"
Download notify
: net_name: %s; chain_id: %d; download:%d%c"
,
a_chain
->
net_name
,
a_chain
->
id
.
uint64
,
a_chain
->
down
load_p
ercentage
,
'%'
);
log_it
(
L_DEBUG
,
"
Load progress
: net_name: %s; chain_id: %d; download:%d%c"
,
a_chain
->
net_name
,
a_chain
->
id
.
uint64
,
a_chain
->
load_p
rogress
,
'%'
);
json_object_put
(
l_chain_info
);
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
modules/chain/dap_chain_cell.c
+
2
−
2
View file @
80b132d2
...
...
@@ -439,7 +439,7 @@ int dap_chain_cell_load(dap_chain_t *a_chain, dap_chain_cell_t *a_cell)
uint64_t
q
=
0
;
if
(
a_chain
->
is_mapped
)
{
a_cell
->
map_pos
=
a_cell
->
map
+
sizeof
(
dap_chain_cell_file_header_t
);
for
(
uint64_t
l_el_size
=
0
;
l_pos
<
l_size
;
++
q
,
l_pos
+=
l_el_size
+
sizeof
(
uint64_t
),
a_chain
->
down
load_p
ercentage
=
(
int
)((
double
)
l_pos
/
l_size
*
100
+
0
.
5
))
{
for
(
uint64_t
l_el_size
=
0
;
l_pos
<
l_size
;
++
q
,
l_pos
+=
l_el_size
+
sizeof
(
uint64_t
),
a_chain
->
load_p
rogress
=
(
int
)((
double
)
l_pos
/
l_size
*
100
+
0
.
5
))
{
size_t
space_left
=
(
size_t
)(
a_cell
->
map_end
-
a_cell
->
map_pos
);
if
(
space_left
<
sizeof
(
uint64_t
)
||
(
space_left
-
sizeof
(
uint64_t
))
<
*
(
uint64_t
*
)
a_cell
->
map_pos
)
if
(
s_cell_map_new_volume
(
a_cell
,
l_pos
)
)
...
...
@@ -468,7 +468,7 @@ int dap_chain_cell_load(dap_chain_t *a_chain, dap_chain_cell_t *a_cell)
break
;
}
l_pos
+=
sizeof
(
uint64_t
)
+
(
l_read
=
fread
((
void
*
)
l_element
,
1
,
l_el_size
,
a_cell
->
file_storage
)
);
a_chain
->
down
load_p
ercentage
=
(
int
)((
double
)
l_pos
/
l_size
*
100
+
0
.
5
);
a_chain
->
load_p
rogress
=
(
int
)((
double
)
l_pos
/
l_size
*
100
+
0
.
5
);
if
(
l_read
!=
l_el_size
)
{
log_it
(
L_ERROR
,
"Read only %lu of %zu bytes, stop cell loading"
,
l_read
,
l_el_size
);
DAP_DELETE
(
l_element
);
...
...
This diff is collapsed.
Click to expand it.
modules/chain/include/dap_chain.h
+
1
−
1
View file @
80b132d2
...
...
@@ -140,7 +140,7 @@ typedef struct dap_chain {
char
*
net_name
;
bool
is_datum_pool_proc
;
bool
is_mapped
;
atomic_int
down
load_p
ercentage
;
atomic_int
load_p
rogress
;
// Nested cells (hashtab by cell_id)
dap_chain_cell_t
*
cells
;
dap_chain_cell_id_t
active_cell_id
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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