Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
juanboy
2024-07-04 15:34:08 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
52bc0028aab5ad2675c196f66f2519be1912cfee
52bc0028
2 parents
b3b3cff5
0f0b170d
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
app.py
app.py
View file @
52bc002
...
...
@@ -44,15 +44,15 @@ def run_script():
for
script_name
,
script_path
in
scripts
:
try
:
print
(
f
"Running {script_name}..."
)
result
=
subprocess
.
run
([
'python'
,
script_path
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
print
(
f
"{script_name} finished successfully. Output:
\n
{result.stdout.decode()}"
)
subprocess
.
run
([
'python'
,
script_path
],
check
=
True
)
print
(
f
"{script_name} finished successfully."
)
except
subprocess
.
CalledProcessError
as
e
:
print
(
f
"An error occurred while running {script_name}: {e
.stderr.decode()
}"
)
print
(
f
"An error occurred while running {script_name}: {e}"
)
if
__name__
==
'__main__'
:
scheduler
=
BackgroundScheduler
(
timezone
=
utc
)
scheduler
.
add_job
(
run_script
,
'interval'
,
hours
=
5
)
scheduler
.
add_job
(
run_script
,
'interval'
,
minutes
=
1
)
scheduler
.
start
()
try
:
...
...
Please
register
or
login
to post a comment