Skip to content

Commit

Permalink
add end_date and indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelmuller committed Oct 16, 2017
1 parent f56b7b9 commit d04c400
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fame/core/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self, values):
self['probable_names'] = []
self['options'] = {}
self['date'] = datetime.datetime.now()
self['end_date'] = None
self['groups'] = []
self['analyst'] = []
MongoDict.__init__(self, values)
Expand Down Expand Up @@ -322,6 +323,7 @@ def _init_threat_intelligence(self):

def _mark_as_finished(self):
self.update_value('status', self.STATUS_FINISHED)
self.update_value('end_date', datetime.datetime.now())
self._reporting_hook('done')

def _get_module(self, module_name):
Expand Down
4 changes: 4 additions & 0 deletions fame/core/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ def connect(self):
self.db.authenticate(fame_config.mongo_user, quote_plus(fame_config.mongo_password), mechanism='SCRAM-SHA-1')

# Create indexes
self.files.create_index('md5')
self.files.create_index('sha1')
self.files.create_index('sha256')
self.files.create_index([("$**", TEXT)], background=True)
self.analysis.create_index('date')
self.analysis.create_index([("$**", TEXT)], background=True)

def collection(self, name):
Expand Down

0 comments on commit d04c400

Please sign in to comment.