/// <summary> /// see whether task has some success /// </summary> /// <param name="task"></param> /// <param name="minnetsuccess"></param> /// <returns></returns> public static bool HasNetSuccess(string task, int minnetsuccess) { TaskStatus ts = new TaskStatus(); string fn = GetDbPath(task); if (Util.FromFile<TaskStatus>(fn, ref ts)) { return ts.NetSuccess >= minnetsuccess; } return false; }
/// <summary> /// gets a task /// </summary> /// <param name="task"></param> /// <returns></returns> public static TaskStatus GetTask(string task) { TaskStatus ts = new TaskStatus(); string fn = GetDbPath(task); if (Util.FromFile<TaskStatus>(fn, ref ts)) { return ts; } return ts; }
/// <summary> /// count successful task /// </summary> /// <param name="task"></param> public static void CountSuccess(string task) { TaskStatus ts = new TaskStatus(); string fn = GetDbPath(task); if (Util.FromFile<TaskStatus>(fn, ref ts)) { } ts.Task = task; ts.Attempts++; ts.Successes++; Util.ToFile<TaskStatus>(ts, fn); }