Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
e2a713b7
Commit
e2a713b7
authored
Oct 18, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X writer to N1
parent
c89ed4a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
t/N1-writer
t/N1-writer
+43
-0
No files found.
t/N1-writer
0 → 100755
View file @
e2a713b7
#!/usr/bin/env python
# writes to N1 periodically
from
ZODB
import
DB
from
neo.client.Storage
import
Storage
from
neo.lib
import
logging
import
transaction
from
time
import
sleep
import
subprocess
from
logging
import
getLogger
,
DEBUG
,
INFO
from
neo.lib
import
logging
def
main
():
getLogger
().
setLevel
(
DEBUG
)
master
=
subprocess
.
check_output
(
"neoctl -a 127.0.0.1:5551 print node |grep MASTER |awk '{print $5}'"
,
shell
=
True
)
print
"master:"
,
`master`
kw
=
{
'master_nodes'
:
master
,
'name'
:
'neo1'
,
}
stor
=
Storage
(
**
kw
)
db
=
DB
(
stor
)
conn
=
db
.
open
()
root
=
conn
.
root
()
print
'Connected to db ok, starting...'
i
=
0
while
1
:
i
+=
1
root
.
obj
=
i
txn
=
transaction
.
get
()
note
=
'change #%i'
%
i
txn
.
note
(
note
)
txn
.
commit
()
print
(
note
)
sleep
(
1
)
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
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