Skip to content

Commit 10a3b5c

Browse files
committed
[worker.php] Update the cleanup section
1 parent c0ca1e4 commit 10a3b5c

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

www/daemon/worker.php

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -118,41 +118,22 @@
118118
}
119119
}
120120

121-
// Delete hidden MacOS dot files from boot partition
121+
// Cleanup:
122+
// - Delete hidden MacOS dot files from boot partition
122123
if (file_exists(BOOT_DIR . '/.fseventsd')) {
123124
sysCmd('rm -rf ' . BOOT_DIR . '/.fseventsd');
124125
sysCmd('rm -rf ' . BOOT_DIR . '/.Spotlight-V100');
125126
workerLog('worker: Boot folder: cleaned');
126127
} else {
127128
workerLog('worker: Boot folder: ok');
128129
}
129-
// Delete embedded \r from cfg_radio table (bugfix)
130-
$result = sqlQuery("SELECT count() FROM cfg_radio WHERE monitor != 'Yes' AND length(monitor) = 3", $dbh);
131-
if ($result[0]['count()'] > 0) {
132-
sqlQuery("UPDATE cfg_radio SET monitor = 'No' WHERE monitor != 'Yes' AND length(monitor) = 3", $dbh);
133-
workerLog('worker: Radio table: cleaned (' . $result[0]['count()'] . ')');
134-
} else {
135-
workerLog('worker: Radio table: ok');
136-
}
137-
// For this series: Delete session vars that have been removed or renamed
130+
// - Delete session vars that have been removed or renamed
138131
$sessionVars = array(
139-
'usb_auto_updatedb',
140-
'src_action',
141-
'src_mpid',
142-
'adaptive',
143-
'localui',
144-
'touchscn',
145-
'scnblank',
146-
'scnrotate',
147-
'scnbrightness',
148-
'rpi_scntype',
149-
'rpi_backlight',
150-
'dsi_backlight',
151-
'usb_auto_mounter'
152132
);
153133
foreach ($sessionVars as $var) {
154134
sysCmd('moodeutl -D ' . $var);
155135
}
136+
// - Delete orphaned session files
156137
purgeSessionFiles();
157138
workerLog('worker: PHP session: cleaned');
158139

0 commit comments

Comments
 (0)