Skip to content

Commit

Permalink
fix: listsync using private vars
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed May 8, 2021
1 parent 043122c commit 4a7faf0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/ListSync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ end
local function weekEntryIterator(listSync, week)
local sortedList = listSync._stateManager:getSortedList()

local position = sortedList:searchGreaterThanOrEqual({t = Util.WeekStart(week) })
local search = LogEntry:new()
search:setTime(Util.WeekStart(week))
search:setCounter(-1 * math.huge)

local position = sortedList:searchGreaterThanOrEqual(search)
local stateManager = listSync._stateManager
local entries = sortedList:entries()

Expand Down Expand Up @@ -331,8 +335,12 @@ function ListSync:enableSending()
self.advertiseTicker = C_Timer.NewTicker(10, function()

-- Get week hash for the last weeks.
local list = self._stateManager:getSortedList()
if list:length() == 0 then
return
end
local now = Util.time()
local firstWeek = self._stateManager:getSortedList():head():weekNumber()
local firstWeek = LogEntry.weekNumber(list:head())
local currentWeek = Util.WeekNumber(now)
self.logger:Info("Announcing hashes of last %d weeks + %d rolling weeks starting at %d", self.advertiseCount, self.advertiseCount, self.advertiseRollingOffset)
local message = AdvertiseHashMessage.create(
Expand Down

0 comments on commit 4a7faf0

Please sign in to comment.