Skip to content

Commit abc059d

Browse files
committed
refactor(stats): use maildir message adapter for scans
1 parent bf9eb45 commit abc059d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/zlibs/stats

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ EOF
132132
act "gathering timestamps..."
133133
for m in ${maildirs}; do
134134
func " ${m}"
135-
rm -rf $TMPDIR/weekstats.db.mdir
136-
cp -r $MAILDIRS/${m} $TMPDIR/weekstats.db.mdir
137-
for f in `${=find} $TMPDIR/weekstats.db.mdir -type f`; do
135+
for f in ${(f)"$(maildir_list_messages "$MAILDIRS/$m")"}; do
138136
timestamp=`fetchdate ${f} "%Y-%U"`
139137
mdir="${m[(ws:.:)1]}"
140138
cat <<EOF | ${SQL} -batch $db > $sql
@@ -233,7 +231,7 @@ EOF
233231
return 1 }
234232

235233
for m in ${maildirs}; do
236-
for f in `${=find} $MAILDIRS/${m} -type f`; do
234+
for f in ${(f)"$(maildir_list_messages "$MAILDIRS/$m")"}; do
237235
timestamp=`fetchdate ${f} "%Y-%m-%d"`
238236
cat <<EOF | ${SQL} -batch $TMPDIR/timecloud.db.$id > $TMPDIR/timecloud.select.$id
239237
SELECT * FROM stats

0 commit comments

Comments
 (0)