mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-09-11 03:57:40 +02:00
update to 6.8.27
This commit is contained in:
+15
-12
@@ -304,23 +304,26 @@ class Sql():
|
||||
|
||||
#是否有锁
|
||||
def is_lock(self):
|
||||
n = 0
|
||||
while os.path.exists(self.__LOCK):
|
||||
n+=1
|
||||
if n > 100:
|
||||
self.rm_lock()
|
||||
break
|
||||
time.sleep(0.01)
|
||||
return
|
||||
# n = 0
|
||||
# while os.path.exists(self.__LOCK):
|
||||
# n+=1
|
||||
# if n > 100:
|
||||
# self.rm_lock()
|
||||
# break
|
||||
# time.sleep(0.01)
|
||||
#写锁
|
||||
def write_lock(self):
|
||||
self.is_lock()
|
||||
with open(self.__LOCK,'wb+') as f:
|
||||
f.close()
|
||||
return
|
||||
# self.is_lock()
|
||||
# with open(self.__LOCK,'wb+') as f:
|
||||
# f.close()
|
||||
|
||||
#解锁
|
||||
def rm_lock(self):
|
||||
if os.path.exists(self.__LOCK):
|
||||
os.remove(self.__LOCK)
|
||||
return
|
||||
# if os.path.exists(self.__LOCK):
|
||||
# os.remove(self.__LOCK)
|
||||
|
||||
def query(self,sql,param = ()):
|
||||
#执行SQL语句返回数据集
|
||||
|
||||
Reference in New Issue
Block a user