Skip to content

Commit

Permalink
hotfix: remove cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jcw1031 committed May 7, 2024
1 parent 71ead9d commit a66c9eb
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/main/java/ac/knu/likeknu/service/DeviceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Transactional
@Service
public class DeviceService {

private final DeviceRepository deviceRepository;
private final Set<String> registeredDevices;

public DeviceService(DeviceRepository deviceRepository) {
this.deviceRepository = deviceRepository;
this.registeredDevices = Collections.synchronizedSet(new HashSet<>());
}

public void registerDevice(DeviceRegistrationRequest deviceRequest) {
Expand All @@ -43,9 +38,7 @@ public void registerDevice(DeviceRegistrationRequest deviceRequest) {
.orElseGet(() -> Device.of(deviceRequest));

device.update(deviceRequest);
if (registeredDevices.add(deviceId)) {
deviceRepository.save(device);
}
deviceRepository.save(device);
}

public void modifyCampusByDeviceId(CampusModificationRequest campusModificationRequest) {
Expand Down

0 comments on commit a66c9eb

Please sign in to comment.