Using str_time_to_unix() in process_raw_data()

This commit is contained in:
Andrew Melton 2013-02-15 11:31:53 -05:00
parent 0df411bdce
commit b6bc4ae6e1

View File

@ -364,15 +364,7 @@ def process_raw_data(deployment, args, json_args):
when = body['timestamp']
except KeyError:
when = body['_context_timestamp'] # Old way of doing it
try:
try:
when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S.%f")
except ValueError:
# Old way of doing it
when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f")
except Exception, e:
pass
values['when'] = dt.dt_to_decimal(when)
values['when'] = str_time_to_unix(when)
values['routing_key'] = routing_key
values['json'] = json_args
record = STACKDB.create_rawdata(**values)