Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stechuhr-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
pandemic_Response
stechuhr-client
Commits
42ead06f
Commit
42ead06f
authored
4 years ago
by
David Huss
Browse files
Options
Downloads
Patches
Plain Diff
Try life updating id_patterns from server
parent
41bba04c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
stechuhr_client/client.py
+17
-0
17 additions, 0 deletions
stechuhr_client/client.py
stechuhr_client/config.py
+1
-0
1 addition, 0 deletions
stechuhr_client/config.py
with
18 additions
and
0 deletions
stechuhr_client/client.py
+
17
−
0
View file @
42ead06f
...
...
@@ -320,6 +320,17 @@ def read_key_input(input_queue, config, logger):
time
.
sleep
(
0.01
)
def
update_id_patterns
()
->
'
Config
'
:
if
config
[
"
server
"
][
"
port
"
]
==
80
:
protocol
=
"
http
"
else
:
protocol
=
"
https
"
url
=
'
{}://{}/config/database/id_patterns
'
.
format
(
protocol
,
config
[
"
server
"
][
"
address
"
].
rstrip
(
"
/
"
))
r
=
requests
.
get
(
url
)
print
(
r
.
text
)
# config["client"]["id_patterns"]
def
main
():
logging
.
info
(
'
Starting main() in {}
'
.
format
(
APPLICATION_NAME
))
...
...
@@ -344,6 +355,8 @@ def main():
# Set the LED to display readyness
dispatch_led
(
"
startup
"
,
config
)
last_pattern_update
=
None
# On the main thread handle communications between the two other threads. That means:
# If there is sth. on the input queue, put it onto the output queue if it fits the
# specified format
...
...
@@ -360,6 +373,10 @@ def main():
else
:
time
.
sleep
(
0.01
)
if
last_pattern_update
is
None
or
time
.
time
()
-
last_pattern_update
>
config
[
"
server
"
][
"
update_frequency
"
]:
last_pattern_update
=
time
.
time
()
update_id_patterns
()
time
.
sleep
(
0.01
)
...
...
This diff is collapsed.
Click to expand it.
stechuhr_client/config.py
+
1
−
0
View file @
42ead06f
...
...
@@ -21,6 +21,7 @@ address = "127.0.0.1"
port = 80
timeout = 5
verify_cert = true
update_frequency = 10
[client]
location =
"
lerchenfeld/mensa
"
...
...
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