Skip to content

Commit e60f841

Browse files
Merge pull request #259 from abhitrueprogrammer/prod
Set max pool size
2 parents 57314a1 + 001db61 commit e60f841

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

src/components/UpcomingPaper.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,21 @@ export default function PaperCard({ subject, slots }: PaperCardProps) {
6969
return (
7070
<div
7171
onClick={(e) => {
72-
if (!paperCount) return; // disable click if no papers
7372
e.preventDefault();
7473
const queryParams = new URLSearchParams({ subject });
7574
router.push(`/catalogue?${queryParams.toString()}`);
7675
}}
7776
className={`h-full rounded-sm border-2 border-[#734DFF] bg-[#FFFFFF] text-black shadow-lg transition duration-150 ease-in-out dark:border-[#36266D] dark:bg-[#171720] dark:text-white ${
78-
!paperCount
79-
? "cursor-not-allowed opacity-60 hover:bg-[#FFFFFF] dark:hover:bg-[#171720]"
80-
: "cursor-pointer hover:bg-[#EFEAFF] hover:dark:bg-[#262635]"
77+
// ? "cursor-not-allowed opacity-60 hover:bg-[#FFFFFF] dark:hover:bg-[#171720]"
78+
"cursor-pointer hover:bg-[#EFEAFF] hover:dark:bg-[#262635]"
8179
}`}
8280
>
8381
<div className="border-b-2 border-[#453D60] p-2">
8482
<div className="flex items-start justify-between">
8583
<h2 className="rounded-t-lg px-2 py-1 font-play text-base font-bold md:text-lg md:tracking-widest">
8684
{courseCode}
8785
<div className="text-sm font-normal">
88-
(Papers available: {paperCount})
86+
{paperCount ? `Papers available: ${paperCount}` : "Click to explore"}
8987
</div>
9088
</h2>
9189

@@ -112,15 +110,11 @@ export default function PaperCard({ subject, slots }: PaperCardProps) {
112110
{courseName}
113111
</h2>
114112

115-
{paperCount ? (
113+
{ (
116114
<div className="mt-4 flex flex-wrap gap-2 font-play">
117115
{slots?.map((slotValue) => capsule(slotValue))}
118116
</div>
119-
) : (
120-
<div className="mt-6 text-sm italic text-gray-500 dark:text-gray-400">
121-
We will have papers for this soon!
122-
</div>
123-
)}
117+
) }
124118
</div>
125119
</div>
126120
);

src/lib/mongoose.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ export async function connectToDatabase() {
2121
return cached.conn;
2222
}
2323
if (cached && !cached.promise) {
24-
const opts = {
24+
25+
cached.promise = mongoose.connect(MONGODB_URI, {
26+
maxConnecting: 2,
2527
bufferCommands: false,
26-
};
27-
cached.promise = mongoose.connect(MONGODB_URI, opts).then((mongoose) => {
28+
maxPoolSize: 10,
29+
}).then((mongoose) => {
2830
return mongoose;
2931
});
3032
}

0 commit comments

Comments
 (0)