Skip to content

Commit

Permalink
Fix:DBConnection don't close
Browse files Browse the repository at this point in the history
  • Loading branch information
尧杰 曾 committed Aug 13, 2022
1 parent e1f5dd6 commit acad50e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions PermissionSync/Database/DBManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,21 @@ public List<PermissionData> GetDBPermissionGroup(CSteamID steamID,EDBQueryType t
}
connection.Open();
var reader = command.ExecuteReader();
// Logger.LogWarning("[GetDB]");
while(reader.Read())
{
PermissionData permissionData = new PermissionData(new CSteamID(Convert.ToUInt64(reader["SteamID"])), reader["PermissionGroup"].ToString(), DateTime.Parse(reader["ExpireDate"].ToString()), reader["Operator"].ToString());
permissionDatas.Add(permissionData);
//Logger.LogWarning("[DEBUG]SID:" + permissionData.SteamID + "PG:" + permissionData.PermissionID + "Date" + permissionData.ExpireDate);
permissionDatas.Add(permissionData);
}
//Logger.LogWarning("[GetDBS]");

}
catch(Exception ex)
{
Logger.LogException(ex);
}
finally
{
connection.Close();
}
return permissionDatas;
}

Expand Down
4 changes: 2 additions & 2 deletions PermissionSync/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.3")]
[assembly: AssemblyFileVersion("1.0.1.3")]
[assembly: AssemblyVersion("1.0.1.4")]
[assembly: AssemblyFileVersion("1.0.1.4")]

0 comments on commit acad50e

Please sign in to comment.