- penyederhanaan dependency injection konfigurasi presensi dan service asinkronisasi
This commit is contained in:
parent
81d425bf57
commit
961696d55f
@ -4,6 +4,7 @@ import java.util.concurrent.Executor;
|
|||||||
|
|
||||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||||
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
|
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
@ -20,11 +21,17 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
public class AsynchLogConfigure implements AsyncConfigurer {
|
public class AsynchLogConfigure implements AsyncConfigurer {
|
||||||
|
|
||||||
|
@Value("${corePoolSizeAsyncConfigurer}")
|
||||||
|
Integer corePoolSizeAsyncConfigurer;
|
||||||
|
|
||||||
|
@Value("${maxPoolSizeAsyncConfigurer}")
|
||||||
|
Integer maxPoolSizeAsyncConfigurer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Executor getAsyncExecutor() {
|
public Executor getAsyncExecutor() {
|
||||||
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
|
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
|
||||||
taskExecutor.setCorePoolSize(50);
|
taskExecutor.setCorePoolSize(corePoolSizeAsyncConfigurer);
|
||||||
taskExecutor.setMaxPoolSize(100);
|
taskExecutor.setMaxPoolSize(maxPoolSizeAsyncConfigurer);
|
||||||
taskExecutor.setThreadNamePrefix("jasmed-medifirst2000-executor-");
|
taskExecutor.setThreadNamePrefix("jasmed-medifirst2000-executor-");
|
||||||
taskExecutor.initialize();
|
taskExecutor.initialize();
|
||||||
return taskExecutor;
|
return taskExecutor;
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import javax.imageio.ImageIO;
|
|||||||
import javax.xml.bind.DatatypeConverter;
|
import javax.xml.bind.DatatypeConverter;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.constants.Master;
|
import com.jasamedika.medifirst2000.constants.Master;
|
||||||
@ -43,6 +44,9 @@ import com.jasamedika.medifirst2000.vo.HabsenVO;
|
|||||||
@Service("absensiPegawaiService")
|
@Service("absensiPegawaiService")
|
||||||
public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements AbsensiPegawaiService {
|
public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements AbsensiPegawaiService {
|
||||||
|
|
||||||
|
@Value("${presensiCapturePath}")
|
||||||
|
String presensiCapturePath;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BaseConverterImpl<AbsensiPegawaiVO, AbsensiPegawai> absensiPegawaiConverter;
|
private BaseConverterImpl<AbsensiPegawaiVO, AbsensiPegawai> absensiPegawaiConverter;
|
||||||
|
|
||||||
@ -152,9 +156,7 @@ public class AbsensiPegawaiServiceImpl extends BaseVoServiceImpl implements Abse
|
|||||||
result = workingDir + "\\" + filename;
|
result = workingDir + "\\" + filename;
|
||||||
} else if (your_os.indexOf("nix") >= 0 || your_os.indexOf("nux") >= 0 || your_os.indexOf("mac") >= 0) {
|
} else if (your_os.indexOf("nix") >= 0 || your_os.indexOf("nux") >= 0 || your_os.indexOf("mac") >= 0) {
|
||||||
// if_unix_or_mac
|
// if_unix_or_mac
|
||||||
// result = workingDir + "//mnt//images//" + filename;
|
result = workingDir + presensiCapturePath + filename;
|
||||||
result = workingDir + "//tmp//" + filename;
|
|
||||||
// result = workingDir + "/" + filename;
|
|
||||||
} else {
|
} else {
|
||||||
// unknown_os?
|
// unknown_os?
|
||||||
result = workingDir + "/" + filename;
|
result = workingDir + "/" + filename;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user