trying to prevent race conditions
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
local STATE_IDLE = 0
|
local STATE_IDLE = 0
|
||||||
local STATE_PREQUERY = 1
|
local STATE_PREQUERY = 1
|
||||||
local STATE_POSTQUERY = 2
|
local STATE_POSTQUERY = 2
|
||||||
|
local STATE_PROCESSING = 3 -- doesn't avoid race conditions completely!
|
||||||
|
|
||||||
local NUM_AUCTION_ITEMS_PER_PAGE = 50
|
local NUM_AUCTION_ITEMS_PER_PAGE = 50
|
||||||
|
|
||||||
@@ -109,6 +110,9 @@ end
|
|||||||
|
|
||||||
function processQueryResults()
|
function processQueryResults()
|
||||||
|
|
||||||
|
if not state == STATE_PROCESSING then -- doesn't avoid race conditions completely
|
||||||
|
state = STATE_PROCESSING
|
||||||
|
|
||||||
-- SortAuctionItems("list", "buyout")
|
-- SortAuctionItems("list", "buyout")
|
||||||
-- if IsAuctionSortReversed("list", "buyout") then
|
-- if IsAuctionSortReversed("list", "buyout") then
|
||||||
-- SortAuctionItems("list", "buyout")
|
-- SortAuctionItems("list", "buyout")
|
||||||
@@ -157,12 +161,13 @@ function processQueryResults()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if totalAuctions > (currentPage - 1) * NUM_AUCTION_ITEMS_PER_PAGE + numBatchAuctions then
|
if numBatchAuctions == NUM_AUCTION_ITEMS_PER_PAGE then
|
||||||
state = STATE_PREQUERY
|
state = STATE_PREQUERY
|
||||||
else
|
else
|
||||||
Auctionator_Scan_Complete()
|
Auctionator_Scan_Complete()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user