IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 12, 2008, 12:04:53 PM (18 years ago)
Author:
jhoblitt
Message:

add --timeout option to all ds*ls utilties and other minor doc changes
add the ability to all DataStore::* classes that handle HTTP to pass options directly to LWP::UserAgent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/scripts/dsproductls

    r8707 r17637  
    11#!/usr/bin/env perl
    22
    3 # Copyright (C) 2006  Joshua Hoblitt
     3# Copyright (C) 2006-2008  Joshua Hoblitt
    44#
    5 # $Id: dsproductls,v 1.3 2006-08-30 22:45:53 jhoblitt Exp $
     5# $Id: dsproductls,v 1.4 2008-05-12 22:04:53 jhoblitt Exp $
    66
    77use strict;
     
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($uri, $last_fileset);
     18my ($uri, $last_fileset, $timeout);
    1919
    2020GetOptions(
    2121    'uri|u=s'           => \$uri,
    2222    'last_fileset|l=s'  => \$last_fileset,
     23    'timeout|t'         => \$timeout,
    2324) or pod2usage( 2 );
    2425
     
    2930) unless defined $uri;
    3031
     32# default http request timeout is 30s
     33$timeout ||= 30;
     34
    3135my %p = (
    3236    uri     => $uri,
     
    3539$p{last_fileset} = $last_fileset if defined $last_fileset;
    3640
    37 my $response = DataStore::Product->new(%p)->request;
     41my $response = DataStore::Product->new(%p)->request(
     42        ua_args  => { timeout => $timeout },
     43    );
    3844
    3945die "request failed" unless defined $response;
     
    8288This flag is optional.
    8389
     90=item * --timeout|-t
     91
     92The ammount of time (in seconds) to wait for a response from the DataStore
     93after making an HTTP request.  The default is 30s.
     94
     95Optional.
     96
    8497=back
    8598
     
    98111=head1 COPYRIGHT
    99112
    100 Copyright (C) 2006  Joshua Hoblitt.  All rights reserved.
     113Copyright (C) 2006-2008  Joshua Hoblitt.  All rights reserved.
    101114
    102115This program is free software; you can redistribute it and/or modify it under
     
    118131=head1 SEE ALSO
    119132
    120 L<DataStore>, L<DataStore::Product>, L<DataStore::FileSet>
     133L<dsget>, L<dsleech>, L<dsrootls>, L<dsproductls>, L<dsfilesetls>, L<DataStore>
    121134
    122135=cut
Note: See TracChangeset for help on using the changeset viewer.