Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DashboardLeaf
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ProjectLeaf
DashboardLeaf
Commits
14949c85
Commit
14949c85
authored
Jan 1, 2021
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
#36 - allow tiles to disable automatic refresh by using "-1" as intervalInSeconds
parent
88d3d5ce
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
src/logic/tile/TileScheduler.py
+8
-2
8 additions, 2 deletions
src/logic/tile/TileScheduler.py
with
9 additions
and
3 deletions
README.md
+
1
−
1
View file @
14949c85
...
...
@@ -37,7 +37,7 @@ The following snippet shows an example of a tile in the settings files.
-
`tileType`
- References the name of a tile class. This class must exist on start of the server.
-
`uniqueName`
- This name must be unique across the complete page.
-
`intervalInSeconds`
- Specifies the automatic refresh rate in seconds.
-
`intervalInSeconds`
- Specifies the automatic refresh rate in seconds
(Use
`-1`
to disable automatic refresh)
.
-
`x`
- Horizontal position in the grid, starting by 0 (
**Note:**
Positions should not be assigned more than once!)
-
`y`
- Vertical position in the grid, starting by 0 (
**Note:**
Positions should not be assigned more than once!)
-
`width`
- The tile's width (minimum is 1 maximum is 12 on desktop horizontal screens)
...
...
This diff is collapsed.
Click to expand it.
src/logic/tile/TileScheduler.py
+
8
−
2
View file @
14949c85
...
...
@@ -35,10 +35,16 @@ class TileScheduler:
LOGGER
.
warning
(
f
'
Tile
"
{
fullName
}
"
already registered
'
)
return
seconds
=
tile
.
get_intervalInSeconds
()
nextRunTime
=
datetime
.
now
()
if
seconds
==
-
1
:
# disable automatic refresh
seconds
=
9999999999
# 317 years
nextRunTime
=
None
# job is paused
job
=
self
.
__scheduler
.
add_job
(
tile
.
update
,
'
interval
'
,
[
pageName
],
seconds
=
tile
.
get_intervalInS
econds
()
,
next_run_time
=
datetime
.
now
()
)
seconds
=
s
econds
,
next_run_time
=
nextRunTime
)
self
.
__jobs
[
fullName
]
=
job
self
.
__cache
[
fullName
]
=
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