Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
naiades
naiades-platform-poc
Commits
d3e6fe2a
Commit
d3e6fe2a
authored
Nov 26, 2020
by
Federico Sismondi
Browse files
Add log on success FS dump with filename
parent
ba0a4ce0
Changes
1
Show whitespace changes
Inline
Side-by-side
dca-carouge-watering/app.py
View file @
d3e6fe2a
...
@@ -382,6 +382,7 @@ def _dump_raw_data_to_filesystem():
...
@@ -382,6 +382,7 @@ def _dump_raw_data_to_filesystem():
app
.
logger
.
info
(
'dumping request to FS'
)
app
.
logger
.
info
(
'dumping request to FS'
)
try
:
try
:
filepath
=
os
.
path
.
join
(
COLLECTION_DIR
,
'{}.json'
.
format
(
int
(
time
.
time
())))
filepath
=
os
.
path
.
join
(
COLLECTION_DIR
,
'{}.json'
.
format
(
int
(
time
.
time
())))
with
open
(
filepath
,
encoding
=
'utf-8'
,
mode
=
'w'
)
as
f
:
with
open
(
filepath
,
encoding
=
'utf-8'
,
mode
=
'w'
)
as
f
:
json
.
dump
(
json
.
dump
(
obj
=
request
.
json
,
obj
=
request
.
json
,
...
@@ -392,6 +393,7 @@ def _dump_raw_data_to_filesystem():
...
@@ -392,6 +393,7 @@ def _dump_raw_data_to_filesystem():
app
.
logger
.
error
(
e
)
app
.
logger
.
error
(
e
)
return
'error'
return
'error'
app
.
logger
.
info
(
"Dumped raw data at file {}"
.
format
(
filepath
))
return
'ok'
return
'ok'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment