Skip to content

Commit

Permalink
Fixed #274 Added has_run to check_taskshed
Browse files Browse the repository at this point in the history
  • Loading branch information
mickem committed Mar 29, 2016
1 parent 78bf943 commit 8744c05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/CheckTaskSched/filter.cpp
Expand Up @@ -65,6 +65,7 @@ tasksched_filter::filter_obj_handler::filter_obj_handler() {
("priority", boost::bind(&filter_obj::get_priority, _1), "Retrieves the priority for the task.")
("task_status", type_custom_state, boost::bind(&filter_obj::get_status, _1), "Retrieves the status of the work item.")
("most_recent_run_time", type_date, boost::bind(&filter_obj::get_most_recent_run_time, _1), "Retrieves the most recent time the work item began running.")
("has_run", type_bool, boost::bind(&filter_obj::get_has_run, _1), "True if the task has ever executed.")
;

registry_.add_human_string()
Expand Down
11 changes: 11 additions & 0 deletions modules/CheckTaskSched/filter.hpp
Expand Up @@ -32,6 +32,9 @@ namespace tasksched_filter {
date_ = date;
never_ = false;
}
bool has_run() const {
return !never_;
}
operator unsigned long long() {
if (never_ || date_ == 0)
return 0;
Expand Down Expand Up @@ -171,6 +174,7 @@ namespace tasksched_filter {
virtual std::string get_status_s() = 0;
virtual long long get_most_recent_run_time() = 0;
virtual std::string get_most_recent_run_time_s() = 0;
virtual bool get_has_run() = 0;
};

struct old_filter_obj : public filter_obj {
Expand Down Expand Up @@ -241,6 +245,10 @@ namespace tasksched_filter {
std::string get_most_recent_run_time_s() {
return format::format_date(get_most_recent_run_time());
}
bool get_has_run() {
return most_recent_run_time(task, title).has_run();
}

};

struct new_filter_obj : public filter_obj {
Expand Down Expand Up @@ -318,6 +326,9 @@ namespace tasksched_filter {
std::string get_most_recent_run_time_s() {
return format::format_date(get_most_recent_run_time());
}
bool get_has_run() {
return most_recent_run_time(task, get_title()).has_run();
}

long long convert_runtime(std::string &) {
return 0;
Expand Down

0 comments on commit 8744c05

Please sign in to comment.