Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
core
picodata
Commits
c990c16f
Commit
c990c16f
authored
2 years ago
by
Georgy Moshkin
Committed by
Georgy Moshkin
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: revise raft_propose_eval args
parent
815440be
No related branches found
No related tags found
1 merge request
!194
feat: revise raft_propose_eval args
Pipeline
#9410
passed
2 years ago
Stage: build
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.rs
+13
-6
13 additions, 6 deletions
src/main.rs
test/conftest.py
+1
-1
1 addition, 1 deletion
test/conftest.py
with
14 additions
and
7 deletions
src/main.rs
+
13
−
6
View file @
c990c16f
...
...
@@ -81,14 +81,21 @@ fn picolib_setup(args: &args::Run) {
Ok
(())
}),
);
#[derive(::tarantool::tlua::LuaRead)]
struct
ProposeEvalOpts
{
timeout
:
Option
<
f64
>
,
}
luamod
.set
(
"raft_propose_eval"
,
tlua
::
function2
(|
timeout
:
f64
,
x
:
String
|
->
Result
<
(),
Error
>
{
traft
::
node
::
global
()
?
.propose
(
traft
::
Op
::
EvalLua
{
code
:
x
},
Duration
::
from_secs_f64
(
timeout
),
)
}),
tlua
::
function2
(
|
x
:
String
,
opts
:
Option
<
ProposeEvalOpts
>
|
->
Result
<
(),
Error
>
{
let
timeout
=
opts
.and_then
(|
opts
|
opts
.timeout
)
.unwrap_or
(
10.0
);
traft
::
node
::
global
()
?
.propose
(
traft
::
Op
::
EvalLua
{
code
:
x
},
Duration
::
from_secs_f64
(
timeout
),
)
},
),
);
luamod
.set
(
"raft_return_one"
,
...
...
This diff is collapsed.
Click to expand it.
test/conftest.py
+
1
−
1
View file @
c990c16f
...
...
@@ -326,8 +326,8 @@ class Instance:
def
raft_propose_eval
(
self
,
lua_code
:
str
,
timeout_seconds
=
2
):
return
self
.
call
(
"
picolib.raft_propose_eval
"
,
timeout_seconds
,
lua_code
,
dict
(
timeout
=
timeout_seconds
),
)
def
assert_raft_status
(
self
,
state
,
leader_id
=
None
):
...
...
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