Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
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
ASTRON SDC
atdb-ldv
Commits
db50cf92
Commit
db50cf92
authored
1 year ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
bugfix SDC-1235
parent
52d732f3
No related branches found
No related tags found
1 merge request
!345
bugfix SDC-1235
Pipeline
#73408
passed
1 year ago
Stage: test
Stage: build
Stage: deploy_to_test
Stage: deploy_to_production
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
atdb/taskdatabase/models.py
+12
-2
12 additions, 2 deletions
atdb/taskdatabase/models.py
atdb/taskdatabase/templates/taskdatabase/index.html
+1
-1
1 addition, 1 deletion
atdb/taskdatabase/templates/taskdatabase/index.html
with
13 additions
and
3 deletions
atdb/taskdatabase/models.py
+
12
−
2
View file @
db50cf92
...
@@ -2,6 +2,7 @@ from django.db import models
...
@@ -2,6 +2,7 @@ from django.db import models
from
django.urls
import
reverse
from
django.urls
import
reverse
from
django.utils
import
timezone
from
django.utils
import
timezone
from
django.utils.timezone
import
datetime
,
timedelta
from
django.utils.timezone
import
datetime
,
timedelta
from
django.core.exceptions
import
MultipleObjectsReturned
from
django.conf
import
settings
from
django.conf
import
settings
import
json
import
json
import
logging
import
logging
...
@@ -609,11 +610,20 @@ class Monitor(models.Model):
...
@@ -609,11 +610,20 @@ class Monitor(models.Model):
# in the LatestMonitor, and update if it is newer.
# in the LatestMonitor, and update if it is newer.
try
:
try
:
latestMonitor
=
LatestMonitor
.
objects
.
get
(
name
=
self
.
name
,
hostname
=
self
.
hostname
)
latestMonitor
=
LatestMonitor
.
objects
.
get
(
name
=
self
.
name
,
hostname
=
self
.
hostname
)
except
MultipleObjectsReturned
as
e
:
# it has happened that latest_monitoring objects failed to delete,
# which leads to a growing database and failure of the 'Hold' button on the Monitoring screen.
LatestMonitor
.
objects
.
all
().
delete
()
try
:
# carry over the metadata, if possible
# carry over the metadata, if possible
latest_metadata
=
latestMonitor
.
metadata
latest_metadata
=
latestMonitor
.
metadata
latestMonitor
.
delete
()
latestMonitor
.
delete
()
except
:
pass
except
Exception
as
error
:
print
(
error
)
# this combination of name and hostname didn't yet exist, create it.
# this combination of name and hostname didn't yet exist, create it.
metadata
=
self
.
metadata
metadata
=
self
.
metadata
...
...
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/templates/taskdatabase/index.html
+
1
−
1
View file @
db50cf92
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %}
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
</div>
</div>
<p
class=
"footer"
>
Version 2
2
Feb 2024
<p
class=
"footer"
>
Version 2
3
Feb 2024
</div>
</div>
{% include 'taskdatabase/refresh.html' %}
{% include 'taskdatabase/refresh.html' %}
...
...
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