MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / task_table_rep

Method task_table_rep

task.py:1992–2006  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1990 os.remove(is_stop_syssafe_file)
1991
1992 def task_table_rep(self):
1993 try:
1994 conn = sqlite3.connect(self.db_file)
1995 cur = conn.cursor()
1996 ret = cur.execute("SELECT count(*) FROM sqlite_master where type='table' and name='tasks' and sql like '%msg%'")
1997 if ret.fetchone()[0] == 0:
1998 cur.execute("ALTER TABLE tasks ADD COLUMN msg TEXT DEFAULT '安装成功'")
1999 ret2 = cur.execute("SELECT count(*) FROM sqlite_master where type='table' and name='tasks' and sql like '%install_status%'")
2000 if ret2.fetchone()[0] == 0:
2001 cur.execute("ALTER TABLE tasks ADD COLUMN install_status INTEGER DEFAULT 1")
2002 cur.close()
2003 conn.commit()
2004 conn.close()
2005 except:
2006 pass
2007
2008 @staticmethod
2009 def save_installed_msg(task_data: dict):

Callers 1

startMethod · 0.95

Calls 4

connectMethod · 0.45
executeMethod · 0.45
closeMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected