[vhffs-dev] [2083] ObjectFactory was required because delete mail uses get_label method from objects

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 2083
Author:   gradator
Date:     2012-02-29 21:49:16 +0100 (Wed, 29 Feb 2012)
Log Message:
-----------
ObjectFactory was required because delete mail uses get_label method from objects

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/ObjectFactory.pm
    trunk/vhffs-robots/src/object_cleanup.pl

Modified: trunk/vhffs-api/src/Vhffs/ObjectFactory.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/ObjectFactory.pm	2012-02-29 20:45:23 UTC (rev 2082)
+++ trunk/vhffs-api/src/Vhffs/ObjectFactory.pm	2012-02-29 20:49:16 UTC (rev 2083)
@@ -51,6 +51,7 @@
 use Vhffs::User;
 use Vhffs::Group;
 use Vhffs::Services;
+use Vhffs::Object;
 
 =head2 fetch_object
 

Modified: trunk/vhffs-robots/src/object_cleanup.pl
===================================================================
--- trunk/vhffs-robots/src/object_cleanup.pl	2012-02-29 20:45:23 UTC (rev 2082)
+++ trunk/vhffs-robots/src/object_cleanup.pl	2012-02-29 20:49:16 UTC (rev 2083)
@@ -34,7 +34,7 @@
 
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Robots;
-use Vhffs::Object;
+use Vhffs::ObjectFactory;
 
 my $vhffs = init Vhffs::Main;
 exit 1 unless defined $vhffs;
@@ -43,8 +43,9 @@
 
 my $objects = Vhffs::Object::getall( $vhffs , undef, Vhffs::Constants::VALIDATION_REFUSED , 1296000 );   # 15 days
 foreach ( @{$objects} ) {
-	Vhffs::Robots::vhffs_log( $vhffs, 'Deleted object '.$_->get_oid.' because it waited too much time in refused state' );
-	$_->delete_withmail;
+	my $object = Vhffs::ObjectFactory::fetch_object( $vhffs, $_->get_oid );
+	Vhffs::Robots::vhffs_log( $vhffs, 'Deleted object '.$object->get_oid.' because it waited too much time in refused state' );
+	$object->delete_withmail;
 }
 
 Vhffs::Robots::unlock( $vhffs, 'object' );


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/