Last active
June 27, 2018 18:44
-
-
Save stavlor/9e3350b50be3d87f4f973ae47b4b1170 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_database_entry(bid, duration, location, starttime, app): | |
import urllib | |
import requests | |
log = logging.getLogger(name="AddDBEntry") | |
data = {'bid': bid, 'dtime': starttime, 'dur': duration, 'quality': 'HQ', 'path': location, 'application': app} | |
url = "http://bcgbe_prd.tnsmi-cmr.com/BeavService/InsertSybase.aspx?" + urllib.parse.urlencode(data) | |
try: | |
result = requests.get(url) | |
except: | |
log.debug('Exception Encountered in Database add!!') | |
send_mail("Exception in add_database_entry!!!" + str( | |
sys.exc_info()) + " Likely no Database entry made for this recording!!.", "Error in add_database_entry!!") | |
log.debug("URL:" + str(url)) | |
log.debug('Result' + str(result.content)) | |
return bool(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment