Skip to content

[Possible BUG ] There may be a possible bug in the function WeeklyReport GetWeeklyReport(...) of the file WeeklyReport/Sheng.Enterprise.Core/WeeklyReportManager.cs. #9

@huskier

Description

@huskier

In the WeeklyReport/Sheng.Enterprise.Core/WeeklyReportManager.cs, there may be a possible bug in the function WeeklyReport GetWeeklyReport(...) .

As the data grows, the time connecting to the server is becoming longer. And it is not reliable to throw exception according to the following count value. We've encountered this issue this morning after the WeeklyReport system has been peacefully running several month.

                public WeeklyReport GetWeeklyReport(Guid userId, int year, int weekOfYear)
		{
			int count = 0;
			this._dataBase.ExecuteScalar<int>("SELECT COUNT(1) FROM [WeeklyReport]", delegate(int scalarValue)
			{
				count = scalarValue;
			});
			if (count >= 500)
			{
				throw new Exception("在建立与服务器的连接时出错,错误代码:5392");
			}

At present, we've just changed the 500 value to 10000, and the issue has been solved. However, in the long run, there may be a better way to cope with this issue.

Huskier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions