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

trydofor / professional-wings / #125

31 Aug 2024 04:46AM UTC coverage: 63.579% (+0.7%) from 62.919%
#125

push

web-flow
Merge pull request #290 from trydofor/develop

3.2.130

1428 of 2191 new or added lines in 106 files covered. (65.18%)

41 existing lines in 24 files now uncovered.

12923 of 20326 relevant lines covered (63.58%)

0.64 hits per line

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

85.71
/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java
1
package pro.fessional.wings.tiny.task.service.impl;
2

3
import lombok.Setter;
4
import lombok.extern.slf4j.Slf4j;
5
import org.jetbrains.annotations.NotNull;
6
import org.jetbrains.annotations.Nullable;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
9
import org.springframework.stereotype.Service;
10
import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
11
import pro.fessional.wings.slardar.async.TaskSchedulerHelper;
12
import pro.fessional.wings.tiny.task.service.TinyTaskConfService;
13
import pro.fessional.wings.tiny.task.service.TinyTaskConfService.Conf;
14
import pro.fessional.wings.tiny.task.service.TinyTaskExecService;
15
import pro.fessional.wings.tiny.task.service.TinyTaskService;
16

17
import java.lang.reflect.Method;
18
import java.util.HashSet;
19
import java.util.Set;
20

21
/**
22
 * @author trydofor
23
 * @since 2022-12-13
24
 */
25
@Service
26
@ConditionalWingsEnabled
27
@Slf4j
1✔
28
public class TinyTaskServiceImpl implements TinyTaskService {
1✔
29

30
    @Setter(onMethod_ = { @Autowired })
31
    protected TinyTaskConfService tinyTaskConfService;
32

33
    @Setter(onMethod_ = { @Autowired })
34
    protected TinyTaskExecService tinyTaskExecService;
35

36
    @Override
37
    @NotNull
38
    public ThreadPoolTaskScheduler referScheduler(boolean fast) {
NEW
39
        return TaskSchedulerHelper.Scheduler(fast);
×
40
    }
41

42
    @Override
43
    @NotNull
44
    public Set<Task> schedule(@NotNull Object taskerBean) {
45
        final Set<Conf> conf = tinyTaskConfService.config(taskerBean);
1✔
46
        final Set<Task> rst = new HashSet<>();
1✔
47
        for (Conf cnf : conf) {
1✔
48
            if (cnf.isEnabled() && cnf.isAutorun() && cnf.isMatched()) {
1✔
49
                final boolean cd = tinyTaskExecService.launch(cnf.getId());
1✔
50
                log.info("schedule bean tiny-task {}, scheduled={}", cnf, cd);
1✔
51
                rst.add(new Task(cnf.getId(), cnf.getKey(), cd));
1✔
52
            }
1✔
53
            else {
54
                log.info("skip bean tiny-task {}", cnf);
1✔
55
            }
56
        }
1✔
57
        return rst;
1✔
58
    }
59

60
    @Override
61
    public Task schedule(@NotNull Object taskerBean, @NotNull Method taskerCall, @Nullable Object taskerPara) {
62
        final Conf cnf = tinyTaskConfService.config(taskerBean, taskerCall, taskerPara);
1✔
63
        final boolean cd;
64
        if (cnf.isEnabled()) {
1✔
65
            cd = tinyTaskExecService.launch(cnf.getId());
×
NEW
66
            log.info("schedule method tiny-task {}, scheduled={}", cnf, cd);
×
67
        }
68
        else {
69
            cd = false;
1✔
70
            log.info("skip method tiny-task {}", cnf);
1✔
71
        }
72

73
        return new Task(cnf.getId(), cnf.getKey(), cd);
1✔
74
    }
75
}
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