Commit b3b9da61 authored by Alain Takoudjou's avatar Alain Takoudjou

slapos_monitoring: fix compatibility with previous version on sync

parent 618653c9
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n CACHE MANIFEST\n
# generated on Fri, 30 June 2016 15:47:33 +0000\n # generated on Fri, 30 June 2016 17:47:33 +0000\n
# XXX + fonts\n # XXX + fonts\n
# images/ajax-loader.gif\n # images/ajax-loader.gif\n
CACHE:\n CACHE:\n
...@@ -340,7 +340,7 @@ NETWORK:\n ...@@ -340,7 +340,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>952.14159.59836.36932</string> </value> <value> <string>952.14160.36945.51916</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -358,7 +358,7 @@ NETWORK:\n ...@@ -358,7 +358,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1467280353.76</float> <float>1467299069.5</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -143,6 +143,20 @@ ...@@ -143,6 +143,20 @@
return gadget.props.jio_gadget.getUrlFeedDescription(options.query); return gadget.props.jio_gadget.getUrlFeedDescription(options.query);
}) })
.push(function (url_list) {
if (url_list.length <= 0) {
// For backward compatibility, sync OMPL if there are empty!
return new RSVP.Queue()
.push(function () {
return gadget.props.jio_gadget.syncMonitoringOpmlData();
})
.push(function () {
return gadget.props.jio_gadget.getUrlFeedDescription(options.query);
});
} else {
return url_list;
}
})
.push(function (url_list) { .push(function (url_list) {
var i, var i,
promise_list = []; promise_list = [];
...@@ -267,7 +281,8 @@ ...@@ -267,7 +281,8 @@
}) })
.push(function (timer_interval) { .push(function (timer_interval) {
if (timer_interval === undefined) { if (timer_interval === undefined) {
timer_interval = 300000; // quickly sync because this is the first run!
timer_interval = 10000;
} }
gadget.props.timer_interval = timer_interval; gadget.props.timer_interval = timer_interval;
return gadget.getSetting('latest_sync_time'); return gadget.getSetting('latest_sync_time');
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>951.28267.48379.7065</string> </value> <value> <string>952.14470.40610.22152</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1466610249.05</float> <float>1467299177.03</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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