private void WriteFile() { while (listqueue.Count > 0) { try { TileQueueInfo queueinfo = listqueue.Dequeue(); string mappath = Folderpath + CreateFolder(queueinfo.maptype) + queueinfo.z + "\\" + queueinfo.x + "\\" + queueinfo.y + JsonHelper.GetValueByKey(queueinfo.maptype).suffix; WriteMapFileByByte(mappath, queueinfo.bytes); } catch (Exception e) { Log4Helper.WriteLog(e.ToString()); } } }
public static void AddQueue(string maptype, string x, string y, string z, byte[] bytes) { TileQueueInfo tilequeueinfo = new TileQueueInfo(); tilequeueinfo.maptype = maptype; tilequeueinfo.x = x; tilequeueinfo.y = y; tilequeueinfo.z = z; tilequeueinfo.bytes = bytes; listqueue.Enqueue(tilequeueinfo); if (Redisbool.ToUpper() == "TRUE") { RedisQueue redisqueue = new RedisQueue(); redisqueue.key = maptype + "-" + JsonHelper.GetValueByKey(maptype).version + "-" + z + "-" + x + "-" + y; redisqueue.bytes = bytes; redislist.Enqueue(redisqueue); } }