REFACTOR to be more modular

This commit is contained in:
2025-05-09 18:56:24 +02:00
parent de382feeff
commit 4d59456292
7 changed files with 36 additions and 68 deletions

View File

@@ -1,6 +1,6 @@
package com.ddf.vodsystem.services;
import com.ddf.vodsystem.entities.Job;
import com.ddf.vodsystem.tools.Job;
import com.ddf.vodsystem.entities.JobStatus;
import jakarta.annotation.PostConstruct;
import org.springframework.stereotype.Service;
@@ -12,7 +12,7 @@ import java.util.HashMap;
import java.util.LinkedList;
@Service
class JobService {
public class JobService {
private static final Logger logger = LoggerFactory.getLogger(JobService.class);
private final HashMap<String, Job> jobs = new HashMap<>();
private final LinkedList<Job> jobQueue = new LinkedList<>();
@@ -39,7 +39,7 @@ class JobService {
}
@PostConstruct
public void startProcessingLoop() {
private void startProcessingLoop() {
Thread thread = new Thread(() -> {
while (true) {
if (!jobQueue.isEmpty()) {