Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
surykatka
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
surykatka
Commits
cd0fb0d3
Commit
cd0fb0d3
authored
May 25, 2021
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bot: ajust crawl interval if previous calculation took too much time
parent
d59efeb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
src/surykatka/bot.py
src/surykatka/bot.py
+9
-1
No files found.
src/surykatka/bot.py
View file @
cd0fb0d3
...
...
@@ -463,12 +463,20 @@ class WebBot:
self
.
_running
=
True
try
:
while
self
.
_running
:
previous_time
=
datetime
.
datetime
.
utcnow
()
self
.
iterateLoop
()
next_time
=
datetime
.
datetime
.
utcnow
()
interval
=
int
(
self
.
config
.
get
(
"INTERVAL"
))
if
interval
<
0
:
self
.
stop
()
else
:
time
.
sleep
(
interval
)
time
.
sleep
(
max
(
0
,
interval
-
(
next_time
-
previous_time
).
total_seconds
(),
)
)
except
KeyboardInterrupt
:
self
.
stop
()
except
:
...
...
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