pr-curve.ts 517 字节
Newer Older
P
Peter Pan 已提交
1
import type {Data, Worker} from './types';
P
Peter Pan 已提交
2 3 4 5 6 7 8

const worker: Worker = async io => {
    const components = await io.getData<string[]>('/components');
    if (!components.includes('pr_curve')) {
        return;
    }

P
Peter Pan 已提交
9 10
    const {runs, tags} = await io.save<Data>('/pr-curve/tags');
    for (const [index, run] of runs.entries()) {
P
Peter Pan 已提交
11
        await io.save('/pr-curve/steps', {run});
P
Peter Pan 已提交
12
        for (const tag of tags[index]) {
P
Peter Pan 已提交
13 14 15 16 17 18
            await io.save('/pr-curve/list', {run, tag});
        }
    }
};

export default worker;