fix init
This commit is contained in:
parent
6211253675
commit
fa22ee34de
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue