({
stateDir,
externalScopeId,
content,
}: {
stateDir: string;
externalScopeId: string;
content: string;
})
| 900 | } |
| 901 | |
| 902 | async function enqueuePendingRestartNotification({ |
| 903 | stateDir, |
| 904 | externalScopeId, |
| 905 | content, |
| 906 | }: { |
| 907 | stateDir: string; |
| 908 | externalScopeId: string; |
| 909 | content: string; |
| 910 | }) { |
| 911 | const filePath = pendingRestartNotificationsFile(stateDir); |
| 912 | const current = readPendingRestartNotifications(filePath) |
| 913 | .filter((item) => item.externalScopeId !== externalScopeId); |
| 914 | current.push({ |
| 915 | externalScopeId, |
| 916 | content, |
| 917 | queuedAt: new Date().toISOString(), |
| 918 | }); |
| 919 | writePendingRestartNotifications(filePath, current); |
| 920 | } |
| 921 | |
| 922 | function pendingRestartNotificationsFile(stateDir: string) { |
| 923 | return path.join(stateDir, 'runtime', 'weixin-restart-notifications.json'); |
no test coverage detected