$VERSION = 1.00;
@ISA = qw(Exporter);
@EXPORT = qw(grabrepolock_reexec
- findtask findtask_spec @all_lock_tables
+ task_spec_desc findtask findtask_spec @all_lock_tables
restrictflight_arg restrictflight_cond
report_run_getinfo report_altcolour
report_altchangecolour
our $taskid;
+sub task_spec_desc ($) {
+ my ($row) = @_; # NB row maybe modifed, to fill in username and comment
+ # => ($newspec, $desc);
+
+ foreach my $k (qw(username comment)) {
+ next if defined $row->{$k};
+ $row->{$k}= "[no $k]";
+ }
+
+ my $newspec = "$row->{taskid} $row->{type} $row->{refkey}";
+ my $desc = "$row->{username} $row->{comment}";
+ return ($newspec,$desc);
+}
+
sub findtask_spec ($$) {
my ($spec, $why) = @_;
die "task $what dead" unless $row->{live};
$q->finish();
- foreach my $k (qw(username comment)) {
- next if defined $row->{$k};
- $row->{$k}= "[no $k]";
- }
-
- my $newspec= "$row->{taskid} $row->{type} $row->{refkey}";
- logm("${why}task $newspec: $row->{username} $row->{comment}");
+ my ($newspec, $desc) = task_spec_desc($row);
+ logm("${why}task $newspec: $desc");
$taskid= $row->{taskid};