List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:September 4 2012 9:25pm
Subject:bzr commit into ABSv2 branch (reggie.burnett:19)
View as plain text  
#At file:///C:/work/wex/absv2/ based on revid:reggie.burnett@stripped

   19 Reggie Burnett	2012-09-04
      added start/stop ability to the utilties

    modified:
      AbsImporter/Program.cs
      AbsJobProcessor/Program.cs
      AbsJobSigner/Program.cs
      AbsUtility/Utility.cs
=== modified file 'AbsImporter/Program.cs'
=== modified file 'AbsImporter/Program.cs'
--- a/AbsImporter/Program.cs	2012-08-24 21:41:22 +0000
+++ b/AbsImporter/Program.cs	2012-09-04 21:25:29 +0000
@@ -14,9 +14,8 @@
     static void Main(string[] args)
     {
       if (WeAreRunning()) return;
-
       if (!Settings.ResolveFolders()) return;
-
+      if (!Utility.ShouldRun()) return;
       try
       {
         foreach (Product p in Product.GetAllProducts())

=== modified file 'AbsJobProcessor/Program.cs'
--- a/AbsJobProcessor/Program.cs	2012-08-28 19:10:02 +0000
+++ b/AbsJobProcessor/Program.cs	2012-09-04 21:25:29 +0000
@@ -17,6 +17,7 @@
       try
       {
         if (!Settings.ResolveFolders()) return;
+        if (!Utility.ShouldRun()) return;
 
         DataSet ds = MySqlHelper.ExecuteDataset(Settings.ConnectionString, "SELECT * FROM abs_jobs WHERE complete_date IS NULL ORDER BY submit_date ASC");
         DataTable dt = ds.Tables[0];

=== modified file 'AbsJobSigner/Program.cs'
--- a/AbsJobSigner/Program.cs	2012-08-28 19:10:02 +0000
+++ b/AbsJobSigner/Program.cs	2012-09-04 21:25:29 +0000
@@ -19,6 +19,7 @@
       try
       {
         if (!Settings.ResolveFolders()) return;
+        if (!Utility.ShouldRun()) return;
 
         DataRow row = MySqlHelper.ExecuteDataRow(Settings.ConnectionString, "SELECT * FROM abs_jobs WHERE status = 'U' ORDER BY submit_date ASC LIMIT 1");
         job = new Job(row);

=== modified file 'AbsUtility/Utility.cs'
--- a/AbsUtility/Utility.cs	2012-08-24 21:41:22 +0000
+++ b/AbsUtility/Utility.cs	2012-09-04 21:25:29 +0000
@@ -146,5 +146,19 @@
         Trace.WriteLine(msg);
       }
     }
+
+    public static bool ShouldRun()
+    {
+      Assembly a = Assembly.GetCallingAssembly();
+
+      string stopFile = a.Location.ToLowerInvariant().Replace(".exe", ".stop");
+      string stoppedFile = stopFile + "ped";
+      if (File.Exists(stopFile))
+      {
+        File.Create(stoppedFile);
+        File.Delete(stopFile);
+      }
+      return !File.Exists(stoppedFile);
+    }
   }
 }


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20120904212529-n1h8i99ve73tb63u.bundle
Thread
bzr commit into ABSv2 branch (reggie.burnett:19) Reggie Burnett5 Sep