Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
106e3707
authored
Mar 06, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: make destroyed/suspended notifications more accurate
parent
d9deb891
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
circle/vm/tasks/local_periodic_tasks.py
+8
-6
No files found.
circle/vm/tasks/local_periodic_tasks.py
View file @
106e3707
...
...
@@ -31,21 +31,23 @@ def garbage_collector(timeout=15):
logger
.
info
(
"Expired instance
%
d destroyed."
,
i
.
pk
)
try
:
i
.
owner
.
profile
.
notify
(
_
(
'
Machine destroyed'
),
_
(
'
%
s destroyed'
)
%
unicode
(
i
),
'dashboard/notifications/vm-destroyed.html'
,
{
'instance'
:
i
})
except
:
logger
.
debug
(
'Could not notify owner of instance
%
d.'
,
i
.
pk
)
except
Exception
as
e
:
logger
.
debug
(
'Could not notify owner of instance
%
d .
%
s'
,
i
.
pk
,
unicode
(
e
))
elif
(
i
.
time_of_suspend
and
now
<
i
.
time_of_suspend
and
i
.
state
==
'RUNNING'
):
i
.
sleep_async
()
logger
.
info
(
"Expired instance
%
d suspended."
%
i
.
pk
)
try
:
i
.
owner
.
profile
.
notify
(
_
(
'
Machine suspended'
),
_
(
'
%
s suspended'
)
%
unicode
(
i
),
'dashboard/notifications/vm-suspended.html'
,
{
'instance'
:
i
})
except
:
logger
.
debug
(
'Could not notify owner of instance
%
d.'
,
i
.
pk
)
except
Exception
as
e
:
logger
.
debug
(
'Could not notify owner of instance
%
d .
%
s'
,
i
.
pk
,
unicode
(
e
))
else
:
logger
.
debug
(
"Instance
%
d didn't expire."
%
i
.
pk
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment