Commit 8a5ba4d9 authored by Ivan Tyagov's avatar Ivan Tyagov

Cache locally remote feed.

parent 2b1a4da8
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
from Products.ERP5Type.Document import newTempBase\n from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Cache import CachingMethod\n
\n \n
request = context.REQUEST\n request = context.REQUEST\n
box_relative_url = kw.get(\'box_relative_url\')\n box_relative_url = kw.get(\'box_relative_url\')\n
...@@ -75,7 +76,10 @@ else:\n ...@@ -75,7 +76,10 @@ else:\n
feed_url = str(preferences.get(\'preferred_rss_feed\',\'\'))\n feed_url = str(preferences.get(\'preferred_rss_feed\',\'\'))\n
username = str(preferences.get(\'preferred_username\',\'\'))\n username = str(preferences.get(\'preferred_username\',\'\'))\n
password = str(preferences.get(\'preferred_password\',\'\'))\n password = str(preferences.get(\'preferred_password\',\'\'))\n
results = context.Base_getRssDataAsDict(context, url = feed_url, username = username, password = password)\n \n
Base_getRssDataAsDict = CachingMethod(context.Base_getRssDataAsDict, \n
(feed_url, username, password), cache_factory=\'erp5_ui_short\')\n
results = Base_getRssDataAsDict(context, url = feed_url, username = username, password = password)\n
\n \n
md5_list = []\n md5_list = []\n
message_list = []\n message_list = []\n
......
741 742
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment