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

teableio / teable / 10160390019

30 Jul 2024 10:08AM CUT coverage: 81.98% (+64.3%) from 17.697%
10160390019

Pull #779

github

web-flow
Merge a160876c8 into 521460d76
Pull Request #779: fix: skip duplicate index

4272 of 4471 branches covered (95.55%)

28270 of 34484 relevant lines covered (81.98%)

1219.86 hits per line

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

0.0
/apps/nestjs-backend/src/worker/parse.ts
1
import { parentPort, workerData } from 'worker_threads';
×
2
import { getRandomString } from '@teable/core';
×
3
import type { IImportConstructorParams } from '../features/import/open-api/import.class';
×
4
import { importerFactory } from '../features/import/open-api/import.class';
×
5

×
6
const parse = () => {
×
7
  const { config, options, id } = { ...workerData } as {
×
8
    config: IImportConstructorParams;
×
9
    options: {
×
10
      skipFirstNLines: number;
×
11
      key: string;
×
12
    };
×
13
    id: string;
×
14
  };
×
15
  const importer = importerFactory(config.type, config);
×
16
  importer.parse(
×
17
    { ...options },
×
18
    async (chunk) => {
×
19
      return await new Promise((resolve) => {
×
20
        const chunkId = `chunk_${getRandomString(8)}`;
×
21
        parentPort?.postMessage({ type: 'chunk', data: chunk, chunkId, id });
×
22
        parentPort?.on('message', (result) => {
×
23
          const { type, chunkId: tunnelChunkId } = result;
×
24
          if (type === 'done' && tunnelChunkId === chunkId) {
×
25
            resolve();
×
26
          }
×
27
        });
×
28
      });
×
29
    },
×
30
    () => {
×
31
      parentPort?.postMessage({ type: 'finished', id });
×
32
      parentPort?.close();
×
33
    },
×
34
    (error) => {
×
35
      parentPort?.postMessage({ type: 'error', data: error, id });
×
36
      parentPort?.close();
×
37
    }
×
38
  );
×
39
};
×
40

×
41
parse();
×
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

© 2025 Coveralls, Inc