• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

telefonicaid / fiware-data-access / 29916526270

22 Jul 2026 11:39AM UTC coverage: 93.813% (-0.3%) from 94.076%
29916526270

Pull #242

github

web-flow
Merge 03f3c17f5 into a2ac8e486
Pull Request #242: Implement consistency refresh

1909 of 2392 branches covered (79.81%)

Branch coverage included in aggregate %.

152 of 152 new or added lines in 3 files covered. (100.0%)

31 existing lines in 2 files now uncovered.

7144 of 7258 relevant lines covered (98.43%)

193.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.64
/src/fetcher.js
1
// Copyright 2025 Telefónica Soluciones de Informática y Comunicaciones de España, S.A.U.
7✔
2
// PROJECT: fiware-data-access
7✔
3
//
7✔
4
// This software and / or computer program has been developed by Telefónica Soluciones
7✔
5
// de Informática y Comunicaciones de España, S.A.U (hereinafter TSOL) and is protected
7✔
6
// as copyright by the applicable legislation on intellectual property.
7✔
7
//
7✔
8
// It belongs to TSOL, and / or its licensors, the exclusive rights of reproduction,
7✔
9
// distribution, public communication and transformation, and any economic right on it,
7✔
10
// all without prejudice of the moral rights of the authors mentioned above. It is expressly
7✔
11
// forbidden to decompile, disassemble, reverse engineer, sublicense or otherwise transmit
7✔
12
// by any means, translate or create derivative works of the software and / or computer
7✔
13
// programs, and perform with respect to all or part of such programs, any type of exploitation.
7✔
14
//
7✔
15
// Any use of all or part of the software and / or computer program will require the
7✔
16
// express written consent of TSOL. In all cases, it will be necessary to make
7✔
17
// an express reference to TSOL ownership in the software and / or computer
7✔
18
// program.
7✔
19
//
7✔
20
// Non-fulfillment of the provisions set forth herein and, in general, any violation of
7✔
21
// the peaceful possession and ownership of these rights will be prosecuted by the means
7✔
22
// provided in both Spanish and international law. TSOL reserves any civil or
7✔
23
// criminal actions it may exercise to protect its rights.
7✔
24

7✔
25
import { getAgenda } from './lib/jobs.js';
7✔
26
import { cleanPartition, processFDAAsync } from './lib/fda.js';
7✔
27
import { getBasicLogger } from './lib/utils/logger.js';
7✔
28

7✔
29
const logger = getBasicLogger();
7✔
30

7✔
31
export async function startFetcher() {
7✔
32
  const agenda = getAgenda();
6✔
33

6✔
34
  const refreshFDA = async (job) => {
6✔
35
    const {
137✔
36
      fdaId,
137✔
37
      query,
137✔
38
      service,
137✔
39
      servicePath,
137✔
40
      timeColumn,
137✔
41
      refreshPolicy,
137✔
42
      objStgConf,
137✔
43
      datasourceId,
137✔
44
    } = job.attrs.data;
137✔
45
    // Should agenda also log errors?
137✔
46
    try {
137✔
47
      await processFDAAsync(
137✔
48
        fdaId,
137✔
49
        query,
137✔
50
        service,
137✔
51
        servicePath,
137✔
52
        timeColumn,
137✔
53
        refreshPolicy,
137!
54
        objStgConf,
136✔
55
        datasourceId,
137✔
56
      );
140✔
57
    } catch (e) {
140✔
58
      logger.error('Fetcher error: ', e);
6✔
59
    }
4✔
60
  };
4✔
61

4✔
62
  const cleanPartitionFDA = async (job) => {
4✔
63
    const { fdaId, service, servicePath, windowSize, objStgConf } =
8✔
64
      job.attrs.data;
8✔
65
    try {
8✔
66
      await cleanPartition(service, fdaId, windowSize, objStgConf, servicePath);
8✔
67
    } catch (e) {
10!
68
      logger.error('Fetcher error: ', e);
4✔
UNCOV
69
    }
×
70
  };
2✔
71

2✔
72
  const consistencyRefreshFDA = async (job) => {
2✔
73
    const {
2✔
74
      fdaId,
2✔
75
      query,
2✔
76
      service,
2✔
77
      servicePath,
2✔
78
      timeColumn,
2✔
79
      refreshPolicy,
2✔
80
      objStgConf,
2✔
81
      datasourceId,
2✔
82
    } = job.attrs.data;
2✔
83
    try {
2✔
84
      await processFDAAsync(
2✔
85
        fdaId,
2✔
86
        query,
2✔
87
        service,
2✔
88
        servicePath,
2✔
89
        timeColumn,
2✔
90
        refreshPolicy,
6✔
91
        objStgConf,
6✔
92
        datasourceId,
6✔
93
      );
6✔
94
    } catch (e) {
6!
95
      logger.error('Fetcher error: ', e);
4✔
96
    }
4✔
97
  };
6✔
98

6✔
99
  agenda.define('refresh-fda', refreshFDA);
6✔
100
  agenda.define('refresh-fda-recurring', refreshFDA);
6✔
101
  agenda.define('clean-partition', cleanPartitionFDA);
6✔
102
  agenda.define('clean-partition-recurring', cleanPartitionFDA);
6✔
103
  agenda.define('consistency-refresh-fda-recurring', consistencyRefreshFDA);
6✔
104

6✔
105
  await agenda.start();
6✔
106
  logger.info('[Fetcher] Agenda started');
6✔
107
}
6✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc