avoid update bus info clean cache
This commit is contained in:
parent
b819715799
commit
b8ce8fa24e
|
@ -2,6 +2,8 @@ module RulingBus
|
|||
class Engine < ::Rails::Engine
|
||||
initializer "ruling_bus" do
|
||||
require File.expand_path('../../../app/models/ruling_bus_setting', __FILE__)
|
||||
require File.expand_path('../../../app/models/ruling_bus_info', __FILE__)
|
||||
require File.expand_path('../../../app/models/ruling_bus_cache', __FILE__)
|
||||
RulingBusSetting.create if RulingBusSetting.first.nil?
|
||||
OrbitApp.registration "RulingBus", :type => "ModuleApp" do
|
||||
module_label "ruling_bus.ruling_bus"
|
||||
|
@ -9,6 +11,14 @@ module RulingBus
|
|||
authorizable
|
||||
categorizable
|
||||
widget_methods ["widget"]
|
||||
if File.basename($0) != 'rake'
|
||||
begin
|
||||
avoid_page_cache RulingBusInfo
|
||||
avoid_page_cache RulingBusCache
|
||||
rescue => e
|
||||
puts ["avoid_page_cache", e.to_s]
|
||||
end
|
||||
end
|
||||
side_bar do
|
||||
head_label_i18n 'ruling_bus.ruling_bus', icon_class: "fa fa-bus"
|
||||
available_for "users"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<div class="col-sm-6">
|
||||
<div>
|
||||
<strong class="route_name">{{route_name}}:</strong>
|
||||
<span class="bus_time">{{time_to_arrive}}</span>
|
||||
<span class="bus_time"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -49,6 +49,7 @@
|
|||
update_bus(ele);
|
||||
},{{update_interval}});
|
||||
}
|
||||
update_bus($('#{{update_id}}[data-list="bus_infos"]')[0]);
|
||||
update_interval_bus($('#{{update_id}}[data-list="bus_infos"]')[0]);
|
||||
</script>
|
||||
<style type="text/css">
|
||||
|
|
Loading…
Reference in New Issue