IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 2, 2007, 5:21:28 PM (19 years ago)
Author:
jhoblitt
Message:

overhaul Nebulous::Client->cull()
add the number of instances to ->stat_object()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Server.pm

    r13173 r13180  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: Server.pm,v 1.32 2007-05-03 01:44:23 jhoblitt Exp $
     3# $Id: Server.pm,v 1.33 2007-05-03 03:21:28 jhoblitt Exp $
    44
    55package Nebulous::Server;
     
    10211021    my ( $key ) = validate_pos( @_,
    10221022        {
    1023             type => SCALAR,
    1024         },
    1025     );
    1026 
    1027     my $log = $self->log;
    1028     my $sql = $self->sql;
    1029     my $db  =$self->db;
    1030 
    1031     $log->debug( "entered - @_" );
     1023            type        => SCALAR,
     1024            callbacks   => {
     1025                'is valid object key' => sub { $self->_is_valid_object_key($_[0]) },
     1026            },
     1027        },
     1028    );
     1029
     1030    my $log = $self->log;
     1031    my $sql = $self->sql;
     1032    my $db  =$self->db;
     1033
     1034    $log->debug("entered - @_");
    10321035
    10331036    my $stat;
    10341037    eval {
    1035         my $query = $db->prepare_cached( $sql->get_object );
    1036         my $rows = $query->execute( $key );
    1037 
    1038         unless ( $rows == 1 ) {
    1039             $log->logdie( "no storage object found" );
     1038        my $query = $db->prepare_cached( $sql->stat_object );
     1039        my $rows = $query->execute($key);
     1040
     1041        unless ($rows == 1) {
     1042            $log->logdie("no storage object found");
    10401043        }
    10411044
    10421045        $stat = $query->fetchrow_arrayref;
    10431046        $query->finish;
    1044 
    1045         $db->commit;
    10461047    };
    10471048    if ( $@ ) {
    10481049        $db->rollback;
    1049         $log->logdie( "database error: $@" );
    1050     }
    1051 
    1052     $log->debug( "leaving" );
     1050        $log->logdie("database error: $@");
     1051    }
     1052
     1053    $log->debug("leaving");
    10531054
    10541055    return $stat;
Note: See TracChangeset for help on using the changeset viewer.