Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8e115155

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 8e1151555c7383bdd4e9baca68e6fa29b48cbd29
  • Vorgänger f7c4665f
  • Nachfolger 29458987

RDBO BackgroundJob(History): Refactoring von Status-Strings

Unterschiede anzeigen:

SL/DB/BackgroundJob.pm
45 45
    $history = SL::DB::BackgroundJobHistory
46 46
      ->new(package_name => $self->package_name,
47 47
            run_at       => $run_at,
48
            status       => 'success',
48
            status       => SL::DB::BackgroundJobHistory::SUCCESS(),
49 49
            result       => $result,
50 50
            data         => $self->data);
51 51
    $history->save;
......
58 58
    $history = SL::DB::BackgroundJobHistory
59 59
      ->new(package_name => $self->package_name,
60 60
            run_at       => $run_at,
61
            status       => 'failure',
61
            status       => SL::DB::BackgroundJobHistory::FAILURE(),
62 62
            error_col    => $error,
63 63
            data         => $self->data);
64 64
    $history->save;
SL/DB/BackgroundJobHistory.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4 1
package SL::DB::BackgroundJobHistory;
5 2

  
6 3
use strict;
......
10 7

  
11 8
__PACKAGE__->meta->initialize;
12 9

  
10
use constant SUCCESS => 'success';
11
use constant FAILURE => 'failure';
12

  
13
sub has_succeeded { $_[0] && (($_[0]->status || '') eq SUCCESS()) }
14
sub has_failed    { $_[0] && (($_[0]->status || '') eq FAILURE()) }
15

  
13 16
1;

Auch abrufbar als: Unified diff