Permalink
Browse files

Some helper methods for links

because we need all the old tickets and transactions imported before
we can create the links, we need to queue them until the end.
  • Loading branch information...
1 parent 0740cc0 commit e4639b74891707309032978c0853c98caa4ea859 @afresh1 committed Aug 11, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 rt-ticket-importer
View
@@ -397,6 +397,27 @@ sub import_link {
}
+{
+ my @link_transactions;
+ my @links;
+
+ sub queue_link_txn { push @link_transactions, @_ }
+
+ sub queue_links {
+ push @links, grep { ref $_ eq 'HASH' and $_->{id} } @_;
+ }
+
+ sub process_queued_links {
+ while ( my $txn = shift @link_transactions ) {
+ ConvertTransaction($txn);
+ }
+
+ while ( my $link = shift @links ) {
+ ConvertLink($link);
+ }
+ }
+}
+
opendir my $dh, $directory or die $!;
my @files = map {"$directory/$_"}
sort grep { $_ =~ /Ticket_\d+\.xml$/i } readdir $dh;

0 comments on commit e4639b7

Please sign in to comment.