Show More
@@ -209,15 +209,16 b' def update_history_from_logs(config, cha' | |||||
209 |
|
209 | |||
210 |
|
210 | |||
211 | def write_history(config, message): |
|
211 | def write_history(config, message): | |
212 | """ writes a messge to a base64encoded filename """ |
|
212 | """ writes a message to a base64encoded filename """ | |
213 | history_location = config.get('history.location') |
|
213 | history_location = config.get('history.location') | |
214 | if not os.path.exists(history_location): |
|
214 | if not os.path.exists(history_location): | |
215 | return |
|
215 | return | |
216 | try: |
|
216 | try: | |
217 | LOCK.acquire_write_lock() |
|
217 | LOCK.acquire_write_lock() | |
218 | filepath = log_filepath(history_location, message['channel']) |
|
218 | filepath = log_filepath(history_location, message['channel']) | |
|
219 | json_message = json.dumps(message) | |||
219 | with open(filepath, 'ab') as f: |
|
220 | with open(filepath, 'ab') as f: | |
220 |
|
|
221 | f.write(json_message) | |
221 | f.write('\n') |
|
222 | f.write('\n') | |
222 | finally: |
|
223 | finally: | |
223 | LOCK.release_write_lock() |
|
224 | LOCK.release_write_lock() |
General Comments 0
You need to be logged in to leave comments.
Login now