Changeset 24440 for trunk/Nebulous/lib
- Timestamp:
- Jun 16, 2009, 2:33:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/lib/Nebulous/Client.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/lib/Nebulous/Client.pm
r24281 r24440 16 16 use Nebulous::Client::Log; 17 17 use Nebulous::Util qw( :standard ); 18 use Params::Validate qw( validate validate_pos SCALAR UNDEF );18 use Params::Validate qw( validate validate_pos SCALAR UNDEF BOOLEAN ); 19 19 #use SOAP::Lite +trace => [qw( debug )]; 20 20 use SOAP::Lite; … … 329 329 my $uri = $self->delete_instance($key, @$locations[0]); 330 330 331 eval { 332 _nuke_file(_get_file_path(@$locations[0])); 333 }; 334 if ($@) { 335 $log->logdie($@); 336 } 337 331 338 $log->debug("leaving"); 332 339 … … 803 810 my $self = shift; 804 811 805 my ( $key ) = validate_pos( @_, 806 { 807 type => SCALAR, 812 my ($key, $force) = validate_pos( @_, 813 { 814 type => SCALAR, 815 }, 816 { 817 type => BOOLEAN, 818 optional => 1, 819 default => undef, 820 callbacks => { 821 'is boolean' => sub { 822 $_[0] == 0 or $_[0] == 1 or $_[0] == undef; 823 }, 824 }, 808 825 }, 809 826 ); … … 817 834 # a lock is implicitly removed when the last storage object is deleted 818 835 foreach my $uri ( @$locations ) { 836 # it is being assumed here that it is better to have files on disk and 837 # not in the database then the inverse. 838 my $path; 839 eval { 840 $path = _get_file_path( $uri ); 841 }; 842 if ($@) { 843 if ($force) { 844 $log->warn($@); 845 $log->warn("exception ignored because force is in effect"); 846 } else { 847 $log->logdie($@); 848 } 849 } 850 819 851 $self->delete_instance($key, $uri) or return undef; 852 853 eval { 854 _nuke_file( $path ); 855 }; 856 if ($@) { 857 if ($force) { 858 $log->warn($@); 859 $log->warn("exception ignored because force is in effect"); 860 } else { 861 $log->logdie($@); 862 } 863 } 820 864 } 821 865 … … 959 1003 $log->debug( "entered - @_" ); 960 1004 961 # it is being assumed here that it is better to have files on disk and not in962 # the database then the inverse.963 964 my $path;965 eval {966 $path = _get_file_path( $uri );967 };968 $log->logdie( $@ ) if $@;969 970 1005 my $response = $self->{ 'server' }->delete_instance($key, $uri); 971 1006 if ( $response->fault ) { … … 981 1016 982 1017 $log->debug( "server deleted instance" ); 983 984 eval {985 _nuke_file( $path );986 };987 $log->logdie( $@ ) if $@;988 1018 989 1019 $log->debug( "leaving" );
Note:
See TracChangeset
for help on using the changeset viewer.
