diff --git a/server/src/api/v1/Files.ts b/server/src/api/v1/Files.ts index f850afc2c..d76ad6c14 100644 --- a/server/src/api/v1/Files.ts +++ b/server/src/api/v1/Files.ts @@ -8,7 +8,6 @@ import moment from 'moment' import multer from 'multer' import { Files as Model } from '../../model/entities/Files' import { Usages } from '../../model/entities/Usages' -import { Redis } from '../../service/Cache' import { TG_CREDS } from '../../utils/Constant' import { buildSort, buildWhereQuery } from '../../utils/FilterQuery' import { Endpoint } from '../base/Endpoint' @@ -28,7 +27,7 @@ export class Files { throw { status: 404, body: { error: 'Parent not found' } } } - const [files, length] = await Redis.connect().getFromCacheFirst(`files:${req.user?.id || 'null'}:${JSON.stringify(req.query || {})}`, async () => await Model.createQueryBuilder('files') + const [files, length] = await Model.createQueryBuilder('files') .where(shared && (parent?.sharing_options?.includes(req.user?.username) || parent?.sharing_options?.includes('*')) ? 'true' : shared ? ':user = any(files.sharing_options) and (files.parent_id is null or parent.sharing_options is null or cardinality(parent.sharing_options) = 0 or not :user = any(parent.sharing_options))' @@ -39,7 +38,7 @@ export class Files { .skip(Number(offset) || 0) .take(Number(limit) || 10) .orderBy(buildSort(sort as string, 'files.')) - .getManyAndCount(), 1) + .getManyAndCount() return res.send({ files, length }) } diff --git a/server/src/api/v1/Users.ts b/server/src/api/v1/Users.ts index 5b135d615..c079387eb 100644 --- a/server/src/api/v1/Users.ts +++ b/server/src/api/v1/Users.ts @@ -70,7 +70,7 @@ export class Users { if (req.user.subscription_id) { try { - paymentDetails = await Redis.connect().getFromCacheFirst(`paypal:subscription:${req.user.subscription_id}`, async () => await new PayPal().getSubscription(req.user.subscription_id), 21600) + paymentDetails = await Redis.connect().getFromCacheFirst(`paypal:subscription:${req.user.subscription_id}`, async () => await new PayPal().getSubscription(req.user.subscription_id), 3) } catch (error) { // ignore } @@ -78,7 +78,7 @@ export class Users { if (req.user.midtrans_id) { try { - midtransPaymentDetails = await Redis.connect().getFromCacheFirst(`midtrans:transaction:${req.user.midtrans_id}`, async () => await new Midtrans().getTransactionStatus(req.user.midtrans_id), 21600) + midtransPaymentDetails = await Redis.connect().getFromCacheFirst(`midtrans:transaction:${req.user.midtrans_id}`, async () => await new Midtrans().getTransactionStatus(req.user.midtrans_id), 3) if (!midtransPaymentDetails?.transaction_status) { midtransPaymentDetails = null } diff --git a/web/src/pages/Login.tsx b/web/src/pages/Login.tsx index 32e8361f0..738cc3644 100644 --- a/web/src/pages/Login.tsx +++ b/web/src/pages/Login.tsx @@ -1,4 +1,4 @@ -import { ArrowRightOutlined, CheckCircleTwoTone, LoginOutlined } from '@ant-design/icons' +import { ArrowRightOutlined, CheckCircleTwoTone, LoginOutlined, GlobalOutlined } from '@ant-design/icons' import { Button, Card, Col, Collapse, Form, Input, Layout, notification, Row, Spin, Steps, Typography } from 'antd' import CountryPhoneInput, { ConfigProvider } from 'antd-country-phone-input' import { useForm } from 'antd/lib/form/Form' @@ -203,7 +203,9 @@ const Login: React.FC = ({ me }) => { - + + Data center region + }> This will affect your upload and download speed, choose the nearest datacenter region to you.