Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
re6stnet
Commits
4f82d0fa
Commit
4f82d0fa
authored
Aug 14, 2012
by
Ulysse Beaugnon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug solved : the used flag was overwrite
parent
17d80ac6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
re6st/db.py
re6st/db.py
+1
-1
No files found.
re6st/db.py
View file @
4f82d0fa
...
@@ -185,6 +185,6 @@ class PeerManager:
...
@@ -185,6 +185,6 @@ class PeerManager:
self
.
_db
.
execute
(
"""DELETE FROM peers WHERE used <= 0 ORDER BY used,
self
.
_db
.
execute
(
"""DELETE FROM peers WHERE used <= 0 ORDER BY used,
RANDOM() LIMIT MAX(0, (SELECT COUNT(*) FROM peers
RANDOM() LIMIT MAX(0, (SELECT COUNT(*) FROM peers
WHERE used <= 0) - ?)"""
,
(
str
(
self
.
_db_size
),))
WHERE used <= 0) - ?)"""
,
(
str
(
self
.
_db_size
),))
self
.
_db
.
execute
(
"INSERT OR
REPLAC
E INTO peers (prefix, address) VALUES (?,?)"
,
peer
)
self
.
_db
.
execute
(
"INSERT OR
IGNOR
E INTO peers (prefix, address) VALUES (?,?)"
,
peer
)
logging
.
debug
(
'Peer added'
)
logging
.
debug
(
'Peer added'
)
return
True
return
True
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