build fix
This commit is contained in:
parent
be51107b1b
commit
80697b4e13
@ -10,13 +10,11 @@ const menuItems = {
|
|||||||
missions: "https://example.com/missions"
|
missions: "https://example.com/missions"
|
||||||
}
|
}
|
||||||
|
|
||||||
type PageProps = {
|
interface SectionParams {
|
||||||
params: {
|
|
||||||
section: string;
|
section: string;
|
||||||
};
|
}
|
||||||
};
|
|
||||||
|
|
||||||
export default async function SectionPage({ params }: PageProps) {
|
export default async function SectionPage({ params }: { params: SectionParams }) {
|
||||||
const section = params?.section ? String(params.section) : '';
|
const section = params?.section ? String(params.section) : '';
|
||||||
|
|
||||||
const iframeUrl = menuItems[section as keyof typeof menuItems];
|
const iframeUrl = menuItems[section as keyof typeof menuItems];
|
||||||
|
|||||||
@ -21,6 +21,20 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data
|
- redis_data:/data
|
||||||
|
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgresql://postgres:postgres@db:5432/calendar_db
|
||||||
|
- REDIS_URL=redis://:mySecretPassword@redis:6379
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db:
|
db:
|
||||||
driver: local
|
driver: local
|
||||||
|
|||||||
@ -1380,3 +1380,49 @@ export async function testEmailConnection(credentials: EmailCredentials): Promis
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force recaching of user credentials
|
||||||
|
* This function is used to refresh credentials in Redis cache
|
||||||
|
*/
|
||||||
|
export async function forceRecacheUserCredentials(userId: string): Promise<boolean> {
|
||||||
|
try {
|
||||||
|
// Get credentials from database
|
||||||
|
const accounts = await prisma.mailCredentials.findMany({
|
||||||
|
where: { userId }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!accounts || accounts.length === 0) {
|
||||||
|
console.log(`No email accounts found for user ${userId}`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recache each account's credentials
|
||||||
|
for (const account of accounts) {
|
||||||
|
const credentials: EmailCredentials = {
|
||||||
|
host: account.host,
|
||||||
|
port: account.port,
|
||||||
|
email: account.email,
|
||||||
|
password: account.password,
|
||||||
|
secure: account.secure,
|
||||||
|
smtp_host: account.smtp_host || undefined,
|
||||||
|
smtp_port: account.smtp_port || undefined,
|
||||||
|
smtp_secure: account.smtp_secure || undefined,
|
||||||
|
display_name: account.display_name || undefined,
|
||||||
|
color: account.color || undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
await cacheEmailCredentials(userId, account.id, credentials);
|
||||||
|
console.log(`Recached credentials for user ${userId}, account ${account.id}`);
|
||||||
|
|
||||||
|
// Invalidate other caches related to this account
|
||||||
|
await invalidateFolderCache(userId, account.id, '*');
|
||||||
|
await invalidateEmailContentCache(userId, account.id, '*');
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error recaching credentials for user ${userId}:`, error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user