forked from p34709852/monkey
Added debug log when renewing TTLs for ease of debugging TTL issues
This commit is contained in:
parent
30dcce4be2
commit
b1cb56d13f
|
@ -2,6 +2,7 @@
|
||||||
Define a Document Schema for the Monkey document.
|
Define a Document Schema for the Monkey document.
|
||||||
"""
|
"""
|
||||||
import mongoengine
|
import mongoengine
|
||||||
|
import logging
|
||||||
from mongoengine import Document, StringField, ListField, BooleanField, EmbeddedDocumentField, ReferenceField, \
|
from mongoengine import Document, StringField, ListField, BooleanField, EmbeddedDocumentField, ReferenceField, \
|
||||||
DateTimeField
|
DateTimeField
|
||||||
|
|
||||||
|
@ -9,6 +10,8 @@ from monkey_island.cc.models.monkey_ttl import MonkeyTtl, create_monkey_ttl_docu
|
||||||
from monkey_island.cc.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS
|
from monkey_island.cc.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class Monkey(Document):
|
class Monkey(Document):
|
||||||
"""
|
"""
|
||||||
This class has 2 main section:
|
This class has 2 main section:
|
||||||
|
@ -79,6 +82,7 @@ class Monkey(Document):
|
||||||
return os
|
return os
|
||||||
|
|
||||||
def renew_ttl(self, duration=DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS):
|
def renew_ttl(self, duration=DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS):
|
||||||
|
logger.debug("Renewing TTL for monkey {0}".format(self.guid))
|
||||||
self.ttl_ref = create_monkey_ttl_document(duration)
|
self.ttl_ref = create_monkey_ttl_document(duration)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue