Merge lp:~ted/url-dispatcher/no-db-no-play into lp:url-dispatcher/15.10

Proposed by Ted Gould
Status: Merged
Approved by: Bill Filler
Approved revision: 98
Merged at revision: 90
Proposed branch: lp:~ted/url-dispatcher/no-db-no-play
Merge into: lp:url-dispatcher/15.10
Diff against target: 45 lines (+14/-2)
3 files modified
data/url-dispatcher.conf.in (+10/-1)
service/dispatcher.c (+1/-0)
service/service.c (+3/-1)
To merge this branch: bzr merge lp:~ted/url-dispatcher/no-db-no-play
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+276922@code.launchpad.net

Commit message

Remove the cache if the service fails to start. Fail to start if we can't create the database.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/url-dispatcher.conf.in'
2--- data/url-dispatcher.conf.in 2014-08-20 18:40:09 +0000
3+++ data/url-dispatcher.conf.in 2015-11-06 23:05:33 +0000
4@@ -8,4 +8,13 @@
5
6 emits application-start
7
8-exec @pkglibexecdir@/url-dispatcher
9+script
10+ @pkglibexecdir@/url-dispatcher
11+ if [ $? -ne 0 ]; then
12+ retval = $?
13+ rm -rf ${HOME}/.cache/url-dispatcher/urls-1.db*
14+ start url-dispatcher-refresh
15+ exit $retval
16+ fi
17+end script
18+
19
20=== modified file 'service/dispatcher.c'
21--- service/dispatcher.c 2015-06-11 21:47:17 +0000
22+++ service/dispatcher.c 2015-11-06 23:05:33 +0000
23@@ -553,6 +553,7 @@
24 cancellable = g_cancellable_new();
25
26 urldb = url_db_create_database();
27+ g_return_val_if_fail(urldb != NULL, FALSE);
28
29 applicationre = g_regex_new("^application:///([a-zA-Z0-9_\\.-]*)\\.desktop$", 0, 0, NULL);
30 appidre = g_regex_new("^appid://([a-z0-9\\.-]*)/([a-zA-Z0-9-]*)/([a-zA-Z0-9\\.-]*)$", 0, 0, NULL);
31
32=== modified file 'service/service.c'
33--- service/service.c 2015-05-15 17:50:57 +0000
34+++ service/service.c 2015-11-06 23:05:33 +0000
35@@ -40,7 +40,9 @@
36 guint term_source = g_unix_signal_add(SIGTERM, sig_term, mainloop);
37
38 OverlayTracker * tracker = overlay_tracker_new();
39- dispatcher_init(mainloop, tracker);
40+ if (!dispatcher_init(mainloop, tracker)) {
41+ return -1;
42+ }
43
44 /* Run Main */
45 g_main_loop_run(mainloop);

Subscribers

People subscribed via source and target branches