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 deleted at timestamp #4493

Merged
merged 1 commit into from
Aug 8, 2022
Merged
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Apollo 2.1.0
* [fix(#4474):'openjdk:8-jre-alpine' potentially causing wrong number of cpu cores](https://github.com/apolloconfig/apollo/pull/4475)
* [Switching spring-session serialization mode to json for compatibility with spring-security version updates]()
* [fix(#4483):Fixed overwrite JSON type configuration being empty](https://github.com/apolloconfig/apollo/pull/4486)
* [fix the deleted at timestamp issue](https://github.com/apolloconfig/apollo/pull/4493)

------------------
All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/11?closed=1)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;

import java.time.Instant;
import java.util.Date;

import javax.persistence.Column;
Expand Down Expand Up @@ -74,18 +73,18 @@ public boolean isDeleted() {

public void setDeleted(boolean deleted) {
isDeleted = deleted;
// also set deletedAt value as epoch millisecond
this.deletedAt = System.currentTimeMillis();
nobodyiam marked this conversation as resolved.
Show resolved Hide resolved
if (deleted && this.deletedAt == 0) {
// also set deletedAt value as epoch millisecond
this.deletedAt = System.currentTimeMillis();
} else if (!deleted) {
this.deletedAt = 0L;
}
}

public long getDeletedAt() {
return deletedAt;
}

public void setDeletedAt(long deletedAt) {
this.deletedAt = deletedAt;
}

public String getDataChangeCreatedBy() {
return dataChangeCreatedBy;
}
Expand Down