Skip to content

Commit

Permalink
block on add/delete in replication server instead of in vhost publish
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Nov 1, 2023
1 parent 41ea161 commit 86afc13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/lavinmq/replication/server.cr
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ module LavinMQ

def append(path : String, obj)
Log.debug { "appending #{obj} to #{path}" }
wait_for_max_lag
each_follower &.append(path, obj)
end

def delete_file(path : String)
@files.delete(path)
wait_for_max_lag
each_follower &.delete(path)
end

Expand Down
2 changes: 0 additions & 2 deletions src/lavinmq/vhost.cr
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ module LavinMQ
find_all_queues(ex, msg.routing_key, headers, visited, found_queues)
headers.delete("BCC") if headers

@replicator.wait_for_max_lag

if found_queues.empty?
ex.unroutable_count += 1
return false
Expand Down

0 comments on commit 86afc13

Please sign in to comment.