clear signup_info cache when starting xmlrpcd, RT#9380
authormark <mark>
Wed, 25 Aug 2010 09:42:04 +0000 (09:42 +0000)
committermark <mark>
Wed, 25 Aug 2010 09:42:04 +0000 (09:42 +0000)
FS/FS/ClientAPI/Signup.pm
FS/FS/ClientAPI_XMLRPC.pm
FS/bin/freeside-selfservice-xmlrpcd

index 26d3612..2eefcf8 100644 (file)
@@ -26,6 +26,15 @@ use FS::payby;
 $DEBUG = 0;
 $me = '[FS::ClientAPI::Signup]';
 
+sub clear_cache {
+  warn "$me clear_cache called\n" if $DEBUG;
+  my $cache = new FS::ClientAPI_SessionCache( {
+      'namespace' => 'FS::ClientAPI::Signup',
+  } );
+  $cache->clear();
+  return {};
+}
+
 sub signup_info {
   my $packet = shift;
 
@@ -90,7 +99,7 @@ sub signup_info {
                             ],
 
       'agent' => [ map { my $agent = $_;
-                         { map { $_ => $agent->get($_) } @agent_fields }
+                         +{ map { $_ => $agent->get($_) } @agent_fields }
                        }
                        qsearch('agent', { 'disabled' => '' } )
                  ],
index cfaf009..32e96b8 100644 (file)
@@ -104,6 +104,7 @@ sub ss2clientapi {
   'domain_select_hash'        => 'Signup/domain_select_hash',  # expose?
   'new_customer'              => 'Signup/new_customer',
   'capture_payment'           => 'Signup/capture_payment',
+  'clear_signup_cache'        => 'Signup/clear_cache',
   'agent_login'               => 'Agent/agent_login',
   'agent_logout'              => 'Agent/agent_logout',
   'agent_info'                => 'Agent/agent_info',
index fa745ec..e50d516 100755 (executable)
@@ -63,6 +63,8 @@ logfile("$FREESIDE_LOG/selfservice-xmlrpcd.log");
 
 daemonize2();
 
+FS::ClientAPI::Signup::clear_cache();
+
 my $conf = new FS::Conf;
 
 die "not running; selfservice-xmlrpc conf option is off\n"