Skip to content

Commit

Permalink
add service + timer files to update the ranking database hourly
Browse files Browse the repository at this point in the history
  • Loading branch information
stapelberg committed Jun 18, 2014
1 parent 1edaed5 commit 9943796
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dcs-update-ranking.service
@@ -0,0 +1,15 @@
.include /lib/systemd/system/dcs-common.service

[Unit]
Description=Debian Code Search: update ranking
After=postgresql.service

[Service]
Restart=no
Type=oneshot
ExecStart=/usr/bin/wget -q http://udd.debian.org/udd-popcon.sql.xz -O /tmp/popcon.sql.xz
ExecStart=/bin/sh -c "echo 'DROP TABLE popcon; DROP TABLE popcon_src;' | psql udd"
ExecStart=/bin/sh -c "xz -d -c /tmp/popcon.sql.xz | psql udd"
ExecStart=/bin/sh -c "psql dcs < /usr/share/dcs/schema.sql"
ExecStart=/usr/bin/dcs-compute-ranking \
-mirror_url=http://http.debian.net/debian
9 changes: 9 additions & 0 deletions dcs-update-ranking.timer
@@ -0,0 +1,9 @@
[Unit]
Description=Update ranking every hour

[Timer]
OnActiveSec=1min
OnCalendar=hourly

[Install]
WantedBy=multi-user.target

0 comments on commit 9943796

Please sign in to comment.