Explorar el Código

"TradeController: Could not store Count Item" fix.
During shutdown executeTask() throw exception and buylists not saved.
Caution: first shutdown can be very slow (due to massive amount of non-updated tradelists).

_DS_ hace 16 años
padre
commit
65b9e8647f
Se han modificado 1 ficheros con 10 adiciones y 1 borrados
  1. 10 1
      L2_GameServer/java/net/sf/l2j/gameserver/model/L2TradeList.java

+ 10 - 1
L2_GameServer/java/net/sf/l2j/gameserver/model/L2TradeList.java

@@ -20,6 +20,7 @@ import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -269,7 +270,15 @@ public class L2TradeList
             }
             
             // exec asynchronously
-            ThreadPoolManager.getInstance().executeTask(new TimerSave());
+            try
+            {
+                ThreadPoolManager.getInstance().executeTask(new TimerSave());
+            }
+            catch (RejectedExecutionException e)
+            {
+            	// during shutdown executeTask() failed
+            	saveDataTimer();
+            }
         }
 
         /**