BuildFeed/MongoTimeChecker/Program.cs
Thomas Hounsell 5501453484 Another round of automated time fixes
Curse Mongo driver assuming UTC.
2015-10-27 22:34:58 +00:00

39 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MBuildModel = RedisMongoMigration.Mongo.BuildModel;
using MBuild = RedisMongoMigration.Mongo.Build;
using RBuild = RedisMongoMigration.Redis.Build;
namespace MongoTimeChecker
{
class Program
{
static void Main(string[] args)
{
var builds = RBuild.Select();
MBuild mBuildObj = new MBuild();
foreach (var build in builds)
{
var mBuild = mBuildObj.SelectByLegacyId(build.Id);
if(mBuild != null)
{
bool isSame = mBuild.BuildTime == build.BuildTime;
if(!isSame)
{
Console.WriteLine($"{build.FullBuildString}: {build.BuildTime} != {mBuild.BuildTime}");
DateTime dt = DateTime.SpecifyKind(build.BuildTime.Value, DateTimeKind.Utc);
mBuildObj.UpdateDateOfLegacy(build.Id, dt);
}
}
}
Console.ReadKey();
}
}
}