Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #24 from pandemicsyn/dev
Browse files Browse the repository at this point in the history
Merge Dev
  • Loading branch information
Florian Hines committed Aug 5, 2013
2 parents 9723186 + 336e17b commit 9d6567c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion stalker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


#: Version information (major, minor, revision[, 'dev']).
version_info = (0, 0, 19)
version_info = (0, 0, 21)
#: Version string 'major.minor.revision'.
version = __version__ = ".".join(map(str, version_info))
gettext.install('stalker')
3 changes: 1 addition & 2 deletions stalker/stalker_agent.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os
import json
import urllib2
from eventlet import wsgi
from eventlet.green import subprocess
from eventlet.green import subprocess, urllib2
from socket import gethostname
import eventlet
from stalker.stalker_utils import Daemon, FileLikeLogger, readconf, get_logger
Expand Down
16 changes: 12 additions & 4 deletions stalker/stalker_runner.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import os
import errno
import signal
import urllib2
from time import time

import eventlet
from eventlet.green import urllib2

from bson import ObjectId
from bson.json_util import loads

from stalker.stalker_utils import Daemon, get_logger, get_syslogger, \
TRUE_VALUES, StatsdEvent
eventlet.monkey_patch()
Expand Down Expand Up @@ -188,6 +190,8 @@ def run_check(self, payload):
if previous_status is True:
self._flap_incr(flapid)
query = {'_id': ObjectId(check['_id'])}
if 'follow_up' not in check: #continue to work with old schema
check['follow_up'] = check['interval']
update = {"$set": {'pending': False, 'status': False,
'flapping': self.flapping(flapid),
'next': time() + check['follow_up'],
Expand Down Expand Up @@ -216,9 +220,13 @@ def start(self):
count = len(checks)
self.logger.debug("Got %d checks" % count)
self.statsd.counter('queue.get', count)
check_result = [x for x in self.pool.imap(self.run_check,
checks)]
self.logger.debug(check_result)
try:
check_result = [x for x in self.pool.imap(self.run_check,
checks)]
self.logger.debug(check_result)
except Exception:
self.logger.exception('Error running checks')

else:
self.logger.debug('No checks, sleeping')
eventlet.sleep()
Expand Down

0 comments on commit 9d6567c

Please sign in to comment.