Skip to content

Commit

Permalink
clean merge mess
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Aug 18, 2023
1 parent 43f58c7 commit 55c2412
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
6 changes: 0 additions & 6 deletions src/lavinmq/http/controller/nodes.cr
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ module LavinMQ
end
context
end

put "/api/nodes" do |context, params|
settings = parse_body(context)
@amqp_server.update_replicator_settings(settings)
context
end
end

APPLICATIONS = [{
Expand Down
12 changes: 12 additions & 0 deletions src/lavinmq/replication/server.cr
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,20 @@ module LavinMQ
end
end

def has_min_followers?
@followers.size >= @min_followers
end

getter min_followers

def has_max_lag?
@followers.all? do |f|
f.lag <= @max_lag
end
end

getter max_lag

private def password : String
path = File.join(Config.instance.data_dir, ".replication_secret")
begin
Expand Down
12 changes: 0 additions & 12 deletions static/js/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,6 @@ const followersTable = Table.renderTable('followers', followersTableOpts, (tr, i
Table.renderCell(tr, 3, humanizeBytes(item.sent_bytes - item.acked_bytes), 'right')
})

document.querySelector('#followerSettings').addEventListener('submit', function (evt) {
// evt.preventDefault()
const data = new window.FormData(this)
console.log(data.get('minFollowers'))
const body = {
minFollowers: parseInt(data.get('minFollowers')),
maxLag: parseInt(data.get('maxLag'))
}
HTTP.request('PUT', url, { body })
.then(minFollowers => {}).catch(HTTP.alertErrorHandler)
})

function updateCharts (response) {
if(response[0].mem_used !== undefined) {
const memoryStats = {
Expand Down

0 comments on commit 55c2412

Please sign in to comment.