Add pending update when it does not exist in list.

This commit is contained in:
MobiusDevelopment 2021-01-23 13:03:14 +00:00
parent b1ad584b76
commit 89f2e72b69
2 changed files with 26 additions and 12 deletions

View File

@ -53,7 +53,10 @@ public class BuyListTaskManager
final Integer time = entry.getKey();
synchronized (PENDING_UPDATES)
{
PENDING_UPDATES.add(time);
if (!PENDING_UPDATES.contains(time))
{
PENDING_UPDATES.add(time);
}
}
REFRESH_TIME.put(time, currentTime + (time.intValue() * 60 * 60 * 1000L));
}
@ -86,19 +89,23 @@ public class BuyListTaskManager
}, 50, 50);
}
public void addTime(int time, long refreshTime)
public void addTime(int timeValue, long updateValue)
{
if (refreshTime == 0)
final Integer time = Integer.valueOf(timeValue);
if (updateValue == 0)
{
synchronized (PENDING_UPDATES)
{
PENDING_UPDATES.add(time);
if (!PENDING_UPDATES.contains(time))
{
PENDING_UPDATES.add(time);
}
}
REFRESH_TIME.put(time, System.currentTimeMillis() + (time * 60 * 60 * 1000L));
REFRESH_TIME.put(time, System.currentTimeMillis() + (timeValue * 60 * 60 * 1000L));
}
else
{
REFRESH_TIME.put(time, refreshTime);
REFRESH_TIME.put(time, updateValue);
}
}

View File

@ -53,7 +53,10 @@ public class BuyListTaskManager
final Integer time = entry.getKey();
synchronized (PENDING_UPDATES)
{
PENDING_UPDATES.add(time);
if (!PENDING_UPDATES.contains(time))
{
PENDING_UPDATES.add(time);
}
}
REFRESH_TIME.put(time, currentTime + (time.intValue() * 60 * 60 * 1000L));
}
@ -86,19 +89,23 @@ public class BuyListTaskManager
}, 50, 50);
}
public void addTime(int time, long refreshTime)
public void addTime(int timeValue, long updateValue)
{
if (refreshTime == 0)
final Integer time = Integer.valueOf(timeValue);
if (updateValue == 0)
{
synchronized (PENDING_UPDATES)
{
PENDING_UPDATES.add(time);
if (!PENDING_UPDATES.contains(time))
{
PENDING_UPDATES.add(time);
}
}
REFRESH_TIME.put(time, System.currentTimeMillis() + (time * 60 * 60 * 1000L));
REFRESH_TIME.put(time, System.currentTimeMillis() + (timeValue * 60 * 60 * 1000L));
}
else
{
REFRESH_TIME.put(time, refreshTime);
REFRESH_TIME.put(time, updateValue);
}
}