Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06_1023
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xavier Moyon
SCODOC_R6A06_1023
Commits
10dabb8c
Commit
10dabb8c
authored
4 months ago
by
moyonxavier@gmail.com
Browse files
Options
Downloads
Patches
Plain Diff
Test - Mise en arriere plan du Schedule
parent
415583c2
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
app/__init__.py
+3
-15
3 additions, 15 deletions
app/__init__.py
app/models/assiduitesSenderScheduler.py
+3
-8
3 additions, 8 deletions
app/models/assiduitesSenderScheduler.py
with
6 additions
and
23 deletions
app/__init__.py
+
3
−
15
View file @
10dabb8c
...
@@ -468,22 +468,10 @@ def create_app(config_class=DevConfig):
...
@@ -468,22 +468,10 @@ def create_app(config_class=DevConfig):
# Si la base n'a pas été upgradée (arrive durrant l'install)
# Si la base n'a pas été upgradée (arrive durrant l'install)
# il se peut que la table scodoc_site_config n'existe pas encore.
# il se peut que la table scodoc_site_config n'existe pas encore.
pass
pass
from
app.models.assiduitesSenderScheduler
import
starter
starter
()
return
app
return
app
def
job
():
#if datetime.datetime.today().weekday() == 0:
print
(
"
I
'
m working...
"
)
log
(
"
Le scheduler est là ou pas ??
"
)
from
apscheduler.schedulers.background
import
BackgroundScheduler
log
(
"
In scheduler
"
)
scheduler
=
BackgroundScheduler
()
scheduler
.
add_job
(
job
,
'
cron
'
,
id
=
'
my_task1
'
,
seconds
=
1
)
scheduler
.
start
()
while
True
:
time
.
sleep
(
1
)
def
set_sco_dept
(
scodoc_dept
:
str
,
open_cnx
=
True
):
def
set_sco_dept
(
scodoc_dept
:
str
,
open_cnx
=
True
):
"""
Set global g object to given dept and open db connection if needed
"""
"""
Set global g object to given dept and open db connection if needed
"""
...
...
This diff is collapsed.
Click to expand it.
app/models/assiduitesSenderScheduler.py
+
3
−
8
View file @
10dabb8c
...
@@ -2,21 +2,16 @@ from app import log
...
@@ -2,21 +2,16 @@ from app import log
import
schedule
import
schedule
import
time
import
time
import
datetime
import
datetime
from
apscheduler.schedulers.background
import
BackgroundScheduler
def
job
():
def
job
():
#if datetime.datetime.today().weekday() == 0:
#if datetime.datetime.today().weekday() == 0:
print
(
"
I
'
m working...
"
)
print
(
"
I
'
m working...
"
)
log
(
log
(
"
Le scheduler est là ou pas ??
"
"
Le scheduler est là ou pas ??
"
)
)
from
apscheduler.schedulers.background
import
BackgroundScheduler
def
starter
():
def
starter
():
log
(
"
start sche
"
)
scheduler
=
BackgroundScheduler
()
scheduler
=
BackgroundScheduler
()
scheduler
.
add_job
(
job
,
'
cron
'
,
id
=
'
my_task1
'
,
minute
s
=
1
)
scheduler
.
add_job
(
job
,
'
cron
'
,
id
=
'
my_task1
'
,
second
s
=
1
)
scheduler
.
start
()
scheduler
.
start
()
while
True
:
while
True
:
time
.
sleep
(
1
)
time
.
sleep
(
1
)
\ No newline at end of file
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