Merge lp:~ken-vandine/friends/lp1248143 into lp:friends

Proposed by Ken VanDine
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 241
Merged at revision: 240
Proposed branch: lp:~ken-vandine/friends/lp1248143
Merge into: lp:friends
Diff against target: 48 lines (+6/-6)
2 files modified
data/com.canonical.friends.gschema.xml (+2/-2)
service/src/service.vala (+4/-4)
To merge this branch: bzr merge lp:~ken-vandine/friends/lp1248143
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Bruce Park Approve
Review via email: mp+193990@code.launchpad.net

Commit message

Undo revert for the default polling frequency and ensure interval is set before using it in the timeout.

Description of the change

Undo revert for the default polling frequency and ensure interval is set before using it in the timeout.

To post a comment you must log in.
Revision history for this message
Robert Bruce Park (robru) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/com.canonical.friends.gschema.xml'
--- data/com.canonical.friends.gschema.xml 2013-11-05 12:17:33 +0000
+++ data/com.canonical.friends.gschema.xml 2013-11-05 18:57:18 +0000
@@ -2,9 +2,9 @@
2 <schema id="com.canonical.friends" path="/com/canonical/friends/">2 <schema id="com.canonical.friends" path="/com/canonical/friends/">
33
4 <key name="interval" type="i">4 <key name="interval" type="i">
5 <default>15</default>5 <default>60</default>
6 <summary>Refresh interval in minutes.</summary>6 <summary>Refresh interval in minutes.</summary>
7 <range min="5" max="30"/>7 <range min="15" max="600"/>
8 <description>8 <description>
9 The number of minutes friends-service will wait in between9 The number of minutes friends-service will wait in between
10 attempts at downloading new messages.10 attempts at downloading new messages.
1111
=== modified file 'service/src/service.vala'
--- service/src/service.vala 2013-11-05 12:17:33 +0000
+++ service/src/service.vala 2013-11-05 18:57:18 +0000
@@ -126,6 +126,9 @@
126 model.set_schema_full (SCHEMA);126 model.set_schema_full (SCHEMA);
127 }127 }
128128
129 var settings = new Settings ("com.canonical.friends");
130 settings.bind("interval", this, "interval", 0);
131
129 if (model is Dee.Model)132 if (model is Dee.Model)
130 {133 {
131 debug ("Model with %u rows", model.get_n_rows());134 debug ("Model with %u rows", model.get_n_rows());
@@ -161,7 +164,7 @@
161 debug ("NOT LEADER");164 debug ("NOT LEADER");
162 });165 });
163166
164 Timeout.add_seconds (300, () => {167 Timeout.add_seconds (interval * 60, () => {
165 shared_model.flush_revision_queue();168 shared_model.flush_revision_queue();
166 debug ("Storing model with %u rows", model.get_n_rows());169 debug ("Storing model with %u rows", model.get_n_rows());
167 resources.store ((Dee.SequenceModel)model, "com.canonical.Friends.Streams");170 resources.store ((Dee.SequenceModel)model, "com.canonical.Friends.Streams");
@@ -169,9 +172,6 @@
169 });172 });
170 }173 }
171174
172 var settings = new Settings ("com.canonical.friends");
173 settings.bind("interval", this, "interval", 0);
174
175 Bus.get_proxy.begin<Dispatcher>(BusType.SESSION,175 Bus.get_proxy.begin<Dispatcher>(BusType.SESSION,
176 "com.canonical.Friends.Dispatcher",176 "com.canonical.Friends.Dispatcher",
177 "/com/canonical/friends/Dispatcher",177 "/com/canonical/friends/Dispatcher",

Subscribers

People subscribed via source and target branches

to all changes: