Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
SMASCH
scheduling-system
Commits
c5992c03
Commit
c5992c03
authored
4 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
postgres throws different error than sqlite
parent
f6af6dc9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!275
Resolve "update automatic visit/subject importer"
Pipeline
#34419
passed
4 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/importer/exporter_cron_job.py
+3
-3
3 additions, 3 deletions
smash/web/importer/exporter_cron_job.py
smash/web/importer/importer_cron_job.py
+3
-3
3 additions, 3 deletions
smash/web/importer/importer_cron_job.py
with
6 additions
and
6 deletions
smash/web/importer/exporter_cron_job.py
+
3
−
3
View file @
c5992c03
...
...
@@ -3,7 +3,7 @@ import logging
import
traceback
import
timeout_decorator
from
django.db
import
OperationalError
from
django.db
import
OperationalError
,
ProgrammingError
from
django_cron
import
CronJobBase
,
Schedule
from
web.models
import
ConfigurationItem
...
...
@@ -21,7 +21,7 @@ class SubjectExporterCronJob(CronJobBase):
item
=
ConfigurationItem
.
objects
.
filter
(
type
=
SUBJECT_EXPORT_RUN_AT
).
first
()
if
item
is
not
None
:
RUN_AT_TIMES
=
item
.
value
.
split
(
'
;
'
)
except
OperationalError
:
except
(
OperationalError
,
ProgrammingError
):
# sqlite and postgres throw different errors here
logger
.
debug
(
'
Looks like db is not initialized
'
)
schedule
=
Schedule
(
run_at_times
=
RUN_AT_TIMES
)
...
...
@@ -61,7 +61,7 @@ class VisitExporterCronJob(CronJobBase):
item
=
ConfigurationItem
.
objects
.
filter
(
type
=
VISIT_EXPORT_RUN_AT
).
first
()
if
item
is
not
None
:
RUN_AT_TIMES
=
item
.
value
.
split
(
'
;
'
)
except
OperationalError
:
except
(
OperationalError
,
ProgrammingError
):
# sqlite and postgres throw different errors here
logger
.
debug
(
'
Looks like db is not initialized
'
)
schedule
=
Schedule
(
run_at_times
=
RUN_AT_TIMES
)
code
=
'
web.export_visit_daily_job
'
# a unique code
...
...
This diff is collapsed.
Click to expand it.
smash/web/importer/importer_cron_job.py
+
3
−
3
View file @
c5992c03
...
...
@@ -6,7 +6,7 @@ import os.path
import
traceback
import
timeout_decorator
from
django.db
import
OperationalError
from
django.db
import
OperationalError
,
ProgrammingError
from
django_cron
import
CronJobBase
,
Schedule
from
web.models
import
ConfigurationItem
,
Study
,
VisitImportData
...
...
@@ -26,7 +26,7 @@ class SubjectImporterCronJob(CronJobBase):
item
=
ConfigurationItem
.
objects
.
filter
(
type
=
SUBJECT_IMPORT_RUN_AT
).
first
()
if
item
is
not
None
:
RUN_AT_TIMES
=
item
.
value
.
split
(
'
;
'
)
except
OperationalError
:
except
(
OperationalError
,
ProgrammingError
):
# sqlite and postgres throw different errors here
logger
.
debug
(
'
Looks like db is not initialized
'
)
schedule
=
Schedule
(
run_at_times
=
RUN_AT_TIMES
)
code
=
'
web.import_subjects_daily_job
'
# a unique code
...
...
@@ -71,7 +71,7 @@ class VisitImporterCronJob(CronJobBase):
item
=
VisitImportData
.
objects
.
filter
(
study_id
=
GLOBAL_STUDY_ID
).
first
()
if
item
is
not
None
:
RUN_AT_TIMES
=
item
.
run_at_times
.
split
(
'
;
'
)
except
OperationalError
:
except
(
OperationalError
,
ProgrammingError
):
# sqlite and postgres throw different errors here
logger
.
debug
(
'
Looks like db is not initialized
'
)
schedule
=
Schedule
(
run_at_times
=
RUN_AT_TIMES
)
code
=
'
web.import_visits_daily_job
'
# a unique code
...
...
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