added basic opensrf.system.time method
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 29 Mar 2006 20:38:31 +0000 (20:38 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 29 Mar 2006 20:38:31 +0000 (20:38 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@673 9efc2488-bf62-4759-914b-345cdb29e865

src/perlmods/OpenSRF/Application.pm

index 4723850..99803e8 100644 (file)
@@ -707,6 +707,22 @@ __PACKAGE__->register_method(
        },
 );
 
+sub time_method {
+       my( $self, $conn ) = @_;
+       my $t = time;
+       $t =~ s/\..*//og; # - remove milli/microseconds from Time::HiRes (should we strip this?)
+       return $t;
+}
+__PACKAGE__->register_method(
+       method => 'time_method',
+       argc => 0,
+       api_name => 'opensrf.system.time',
+       signature => {
+               desc => q/Returns the current system time as epoch seconds/,
+               return => { desc => q/epoch seconds/ }
+       }
+);
+
 sub make_stream_atomic {
        my $self = shift;
        my $req = shift;