|
@@ -16,14 +16,25 @@ public class CMoveTask implements ITask {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
// TODO Auto-generated method stub
|
|
|
- List<Record> studyidfinds = Db.use("local").find("select * from study where status =1 or status =2 order by createAt asc limit 2");
|
|
|
+ List<Record> count = Db.use("local").find("select * from study where status =4");
|
|
|
+ //同时下载的队列
|
|
|
+ Integer flag = count.size();
|
|
|
+ if (flag >= 10) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<Record> studyidfinds = Db.use("local").find("select * from study where status =1 or status =2 order by createAt asc limit 4");
|
|
|
if (studyidfinds == null) {
|
|
|
return;
|
|
|
}
|
|
|
for (Record studyidfind : studyidfinds) {
|
|
|
+ flag++;
|
|
|
+ if (flag > 10) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
//状态4:下载中
|
|
|
studyidfind.set("status", 4);
|
|
|
Db.use("local").update("study", studyidfind);
|
|
|
+
|
|
|
ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
|
|
|
tService.execute(() -> {
|
|
|
String execCmd = ExecUtil.execCmd("/zskk_system/other/cmove.sh " + studyidfind.getStr("studyuid"));
|