This commit is contained in:
j 2017-08-19 18:18:45 +02:00
parent 6211253675
commit fa22ee34de

View file

@ -8,7 +8,7 @@ import json
import sqlalchemy as sa import sqlalchemy as sa
from sqlalchemy.sql.expression import text from sqlalchemy.sql.expression import text
from utils import datetime2ts, ts2datetime from utils import datetime2ts, ts2datetime, make_folder
from websocket import trigger_event from websocket import trigger_event
import db import db
import settings import settings
@ -46,6 +46,7 @@ def add_record(action, *args, **kwargs):
else: else:
mode = 'w' mode = 'w'
state.changelog_size = 0 state.changelog_size = 0
make_folder(path)
with open(path, mode) as fd: with open(path, mode) as fd:
fd.write(data + '\n') fd.write(data + '\n')
state.changelog_size = os.path.getsize(path) state.changelog_size = os.path.getsize(path)