Commits

Dominik P  committed eef86b5

Yet another fix in the cron rolling condition logic

  • Participants
  • Parent commits 1c420d1

Comments (0)

Files changed (1)

 
 diff -r 5a5078efc63a src/Appender/RollingFileAppenderNG.cs
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/src/Appender/RollingFileAppenderNG.cs	Wed Sep 21 22:45:24 2011 +0200
++++ b/src/Appender/RollingFileAppenderNG.cs	Wed Sep 21 22:50:10 2011 +0200
 @@ -0,0 +1,143 @@
 +#region Apache License
 +//
 +}
 diff -r 5a5078efc63a src/Appender/RollingFileAppenderNGAPI/CronRollingCondition.cs
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/src/Appender/RollingFileAppenderNGAPI/CronRollingCondition.cs	Wed Sep 21 22:45:24 2011 +0200
++++ b/src/Appender/RollingFileAppenderNGAPI/CronRollingCondition.cs	Wed Sep 21 22:50:10 2011 +0200
 @@ -0,0 +1,198 @@
 +#region Apache License
 +//
 +			{
 +				return false;
 +			}
-+			if (!IsMet(Dow, now))
++			if (!IsMet(Dow, (int)now.DayOfWeek))
 +			{
 +				return false;
 +			}
-+			if (!IsMet(Month, now))
++			if (!IsMet(Month, now.Month))
 +			{
 +				return false;
 +			}
-+			if (!IsMet(Day, now))
++			if (!IsMet(Day, now.Day))
 +			{
 +				return false;
 +			}
-+			if (!IsMet(Hour, now))
++			if (!IsMet(Hour, now.Hour))
 +			{
 +				return false;
 +			}
-+			if (!IsMet(Minute, now))
++			if (!IsMet(Minute, now.Minute))
 +			{
 +				return false;
 +			}
 +
 +		#region Private Methods
 +
-+		private bool IsMet(Tuple<int?, MatchType> match, DateTime now)
++		private bool IsMet(Tuple<int?, MatchType> match, int item)
 +		{
 +			switch (match.Item2)
 +			{
 +				case MatchType.Exact:
-+					if (match.Item1.Value != (int)now.DayOfWeek)
++					if (match.Item1.Value != item)
 +					{
 +						return false;
 +					}
 +					{
 +						return true;
 +					}
-+					else if ((int)now.DayOfWeek % match.Item1.Value != 0)
++					else if (item % match.Item1.Value != 0)
 +					{
 +						return false;
 +					}
 +}
 diff -r 5a5078efc63a src/Appender/RollingFileAppenderNGAPI/IRollingCondition.cs
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/src/Appender/RollingFileAppenderNGAPI/IRollingCondition.cs	Wed Sep 21 22:45:24 2011 +0200
++++ b/src/Appender/RollingFileAppenderNGAPI/IRollingCondition.cs	Wed Sep 21 22:50:10 2011 +0200
 @@ -0,0 +1,38 @@
 +#region Apache License
 +//
 +}
 diff -r 5a5078efc63a src/Appender/RollingFileAppenderNGAPI/IRollingStrategy.cs
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/src/Appender/RollingFileAppenderNGAPI/IRollingStrategy.cs	Wed Sep 21 22:45:24 2011 +0200
++++ b/src/Appender/RollingFileAppenderNGAPI/IRollingStrategy.cs	Wed Sep 21 22:50:10 2011 +0200
 @@ -0,0 +1,32 @@
 +#region Apache License
 +//
 +}
 diff -r 5a5078efc63a src/Appender/RollingFileAppenderNGAPI/IndexRollingStrategy.cs
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/src/Appender/RollingFileAppenderNGAPI/IndexRollingStrategy.cs	Wed Sep 21 22:45:24 2011 +0200
++++ b/src/Appender/RollingFileAppenderNGAPI/IndexRollingStrategy.cs	Wed Sep 21 22:50:10 2011 +0200
 @@ -0,0 +1,77 @@
 +#region Apache License
 +//
 +}
 diff -r 5a5078efc63a src/log4net.vs2010.csproj
 --- a/src/log4net.vs2010.csproj	Tue Sep 20 17:52:26 2011 +0000
-+++ b/src/log4net.vs2010.csproj	Wed Sep 21 22:45:24 2011 +0200
++++ b/src/log4net.vs2010.csproj	Wed Sep 21 22:50:10 2011 +0200
 @@ -187,6 +187,13 @@
      <Compile Include="Appender\RollingFileAppender.cs">
        <SubType>Code</SubType>