Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enedis-scraping-connector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
POCS
cozy
enedis-scraping-connector
Commits
f5fe857e
Commit
f5fe857e
authored
6 years ago
by
i-vall
Browse files
Options
Downloads
Patches
Plain Diff
fix(removeAberrantData): removal of data executes last
parent
04567a6d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/index.js
+13
-8
13 additions, 8 deletions
src/index.js
with
13 additions
and
8 deletions
src/index.js
+
13
−
8
View file @
f5fe857e
...
@@ -28,8 +28,9 @@ async function start(fields) {
...
@@ -28,8 +28,9 @@ async function start(fields) {
log
(
'
info
'
,
'
Getting data
'
)
log
(
'
info
'
,
'
Getting data
'
)
const
loadProfile
=
await
getData
()
const
loadProfile
=
await
getData
()
log
(
'
info
'
,
'
Saving data to Cozy
'
)
log
(
'
info
'
,
'
Saving data to Cozy
'
)
storeLoadProfile
(
loadProfile
)
await
storeLoadProfile
(
loadProfile
)
await
removeAberrantData
()
log
(
'
info
'
,
'
Removing aberrant data
'
)
removeAberrantData
()
}
catch
(
error
)
{
}
catch
(
error
)
{
throw
new
Error
(
error
.
message
)
throw
new
Error
(
error
.
message
)
}
}
...
@@ -100,12 +101,16 @@ async function getData() {
...
@@ -100,12 +101,16 @@ async function getData() {
}
}
}
}
function
storeLoadProfile
(
loadProfile
)
{
async
function
storeLoadProfile
(
loadProfile
)
{
return
hydrateAndFilter
(
loadProfile
,
'
enedis.loadprofile
'
,
{
const
filteredDocuments
=
await
hydrateAndFilter
(
keys
:
[
'
time
'
]
loadProfile
,
}).
then
(
filteredDocuments
=>
{
'
enedis.loadprofile
'
,
addData
(
filteredDocuments
,
'
enedis.loadprofile
'
)
{
})
keys
:
[
'
time
'
]
}
)
const
data
=
await
addData
(
filteredDocuments
,
'
enedis.loadprofile
'
)
return
data
}
}
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment