Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
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
Container 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
Lars Kruse
aura-engine
Commits
ca88c51b
Commit
ca88c51b
authored
4 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Possiblity to limit count of next schedules.
parent
48dc589b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/scheduling/scheduler.py
+24
-18
24 additions, 18 deletions
modules/scheduling/scheduler.py
with
24 additions
and
18 deletions
modules/scheduling/scheduler.py
+
24
−
18
View file @
ca88c51b
...
@@ -320,6 +320,30 @@ class AuraScheduler(threading.Thread):
...
@@ -320,6 +320,30 @@ class AuraScheduler(threading.Thread):
return
current_schedule
return
current_schedule
def
get_next_schedules
(
self
,
max_count
=
0
):
"""
Retrieves the schedules to be played after the current one.
Args:
max_count (Integer): Maximum of schedules to return, if `0` all exitsing ones are returned
Returns:
([Schedule]): The next schedules
"""
now_unix
=
self
.
get_virtual_now
()
next_schedules
=
[]
for
schedule
in
self
.
programme
:
if
schedule
.
start_unix
>
now_unix
:
if
(
len
(
next_schedules
)
<
max_count
)
or
max_count
==
0
:
next_schedules
.
append
(
schedule
)
else
:
break
return
next_schedules
# FIXME Review relevance.
# FIXME Review relevance.
def
get_act_programme_as_string
(
self
):
def
get_act_programme_as_string
(
self
):
"""
"""
...
@@ -561,24 +585,6 @@ class AuraScheduler(threading.Thread):
...
@@ -561,24 +585,6 @@ class AuraScheduler(threading.Thread):
def
get_next_schedules
(
self
):
"""
Retrieves the schedules to be played after the current one.
Returns:
([Schedule]): The next schedules
"""
now_unix
=
self
.
get_virtual_now
()
next_schedules
=
[]
for
schedule
in
self
.
programme
:
if
schedule
.
start_unix
>
now_unix
:
next_schedules
.
append
(
schedule
)
return
next_schedules
def
filter_scheduling_window
(
self
,
schedules
):
def
filter_scheduling_window
(
self
,
schedules
):
"""
"""
Ignore schedules which are beyond the scheduling window. The end of the scheduling window
Ignore schedules which are beyond the scheduling window. The end of the scheduling window
...
...
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