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

telefonicaid / fiware-data-access / 22344330545

24 Feb 2026 09:17AM UTC coverage: 82.874% (+0.7%) from 82.178%
22344330545

Pull #100

github

web-flow
Merge e3fd58d5a into a7c9ab1cb
Pull Request #100: [WIP] Agenda testing

162 of 212 branches covered (76.42%)

Branch coverage included in aggregate %.

151 of 161 new or added lines in 5 files covered. (93.79%)

6 existing lines in 2 files now uncovered.

1672 of 2001 relevant lines covered (83.56%)

8.38 hits per line

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

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

2✔
25
import { initAgenda, shutdownAgenda } from './lib/jobs.js';
2✔
26
import { processFDAAsync } from './lib/fda.js';
2✔
27

2✔
28
async function startWorker() {
2✔
29
  const agenda = await initAgenda();
2✔
30

2✔
31
  agenda.define('refresh-fda', async (job) => {
2✔
32
    const { fdaId, query, service } = job.attrs.data;
7✔
33
    console.log(`[Worker] Hello, ${fdaId}!`);
7✔
34
    await processFDAAsync(fdaId, query, service);
7✔
35
  });
2✔
36

2✔
37
  agenda.on('start', (job) => {
2✔
38
    console.log(`[Worker] Job ${job.attrs.name} starting...`);
7✔
39
  });
2✔
40

2✔
41
  agenda.on('success', (job) => {
2✔
42
    console.log(`[Worker] Job ${job.attrs.name} completed successfully`);
7✔
43
  });
2✔
44

2✔
45
  agenda.on('fail', (err, job) => {
2✔
NEW
46
    console.error(`[Worker] Job ${job.attrs.name} failed:`, err);
×
47
  });
2✔
48

2✔
49
  await agenda.start();
2✔
50
  console.log('[Worker] Agenda started');
2✔
51
}
2✔
52

2✔
53
startWorker().catch((err) => {
2✔
NEW
54
  console.error('[Worker] Failed to start:', err);
×
NEW
55
  process.exit(1);
×
56
});
2✔
57

2✔
58
process.on('SIGINT', async () => {
2✔
NEW
59
  await shutdownAgenda();
×
NEW
60
  process.exit(0);
×
61
});
2✔
62

2✔
63
process.on('SIGTERM', async () => {
2✔
64
  await shutdownAgenda();
2✔
65
  process.exit(0);
2✔
66
});
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc