Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: abtest 데드락 발생 최소화 #1091

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public void removeVariable(AbtestVariable variable) {
);
}

// TODO: 각 로그인 및 리프레시 요청에 추가 필요
public void updateLastAccessedAt(Clock clock) {
this.lastAccessedAt = LocalDateTime.now(clock);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package in.koreatech.koin.admin.abtest.service;

import java.time.Clock;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -51,7 +50,6 @@
@Transactional(readOnly = true)
public class AbtestService {

private final Clock clock;
private final EntityManager entityManager;
private final AbtestVariableCountRepository abtestVariableCountRepository;
private final AbtestRepository abtestRepository;
Expand Down Expand Up @@ -161,7 +159,6 @@ public AbtestAssignResponse assignOrGetVariable(Integer accessHistoryId, UserAge
accessHistory.addAbtestVariable(variable);
countCacheUpdate(variable);
variableAssignCacheSave(variable, accessHistory.getId());
accessHistory.updateLastAccessedAt(clock);
return AbtestAssignResponse.of(variable, accessHistory);
}

Expand Down Expand Up @@ -217,7 +214,6 @@ private AbtestVariable getMyVariable(Integer accessHistoryId, UserAgentInfo user
abtestVariableAssignRepository.save(AbtestVariableAssign.of(dbVariable.getId(), accessHistory.getId()));
return dbVariable;
}
accessHistory.updateLastAccessedAt(clock);
return cacheVariable.get();
}

Expand Down
Loading