summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java
index 19becdf..b1fbb10 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java
@@ -69,7 +69,8 @@ public class ReplicationTasksStorage {
public String persist(ReplicateRefUpdate r) {
String json = GSON.toJson(r) + "\n";
- String eventKey = sha1(json).name();
+ String key = r.project + "\n" + r.ref + "\n" + r.uri + "\n" + r.remote;
+ String eventKey = sha1(key).name();
Path file = refUpdates().resolve(eventKey);
if (Files.exists(file)) {
@@ -91,8 +92,8 @@ public class ReplicationTasksStorage {
}
public void delete(ReplicateRefUpdate r) {
- String taskJson = GSON.toJson(r) + "\n";
- String taskKey = sha1(taskJson).name();
+ String key = r.project + "\n" + r.ref + "\n" + r.uri + "\n" + r.remote;
+ String taskKey = sha1(key).name();
Path file = refUpdates().resolve(taskKey);
if (disableDeleteForTesting) {