Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove print statemens. makes cron send useless emails. #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 3 additions & 8 deletions sch/sch.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def shell(command):
# command = sys.argv[2]
job_id = get_job_id(command)

print("job_id: %s" % job_id + ' ' + command)
logging.info("job_id: %s" % job_id + ' ' + command)
# find system cron job that executes this command
try:
job = Cron(job_id, command).get_job()
Expand All @@ -168,8 +168,7 @@ def shell(command):
check = health_checks.find_check(job)
except Exception as error:
# do not update or create checks because of communication problems
logging.error('Ooops! Could not communicate with the healthchecks API')
print(error)
logging.error('Ooops! Could not communicate with the healthchecks API, error: %s' % error)
interfere = False
else:
if check:
Expand Down Expand Up @@ -412,9 +411,7 @@ def update_check(self, check, job):

# post the data
try:
print('\n\n\n')
print('{}checks/'.format(self.cred.api_url))
print('\n\n\n')
logging.debug('{}checks/'.format(self.cred.api_url))
response = requests.post(
url=check['update_url'],
headers=self.auth_headers,
Expand Down Expand Up @@ -459,8 +456,6 @@ def new_check(self, job):
headers=self.auth_headers,
json=self._metadata
)
print('\n\n\n')
print(response.text)
response.raise_for_status()
except requests.exceptions.HTTPError:
logging.error(
Expand Down