Skip to content

Commit

Permalink
chore: avoid full page reload + run cron only on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi-best committed Dec 5, 2024
1 parent e9a1d45 commit 8bb8da1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
8 changes: 6 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ Deno.serve({ port: PORT }, app.fetch);
Deno.cron('scrape-repositories', '0 */12 * * *', async () => {
console.log('Running repository scraper...');
try {
await scrape();
console.log('Repository scrape completed successfully');
if (Deno.env.get('NODE_ENV') === 'production') {
await scrape();
console.log('Repository scrape completed successfully');
} else {
console.log('Skipping repository scrape in non-production environment');
}
} catch (error) {
console.error('Error running repository scraper:', error);
}
Expand Down
21 changes: 10 additions & 11 deletions src/lib/components/navigation/navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,19 @@
</a>
</p>
<div class="container flex h-14 max-w-screen-2xl items-center">
<div class="mr-4 hidden md:flex">
<a href="/" class="mr-6 flex items-center space-x-4">
<div class="mr-4 hidden md:flex items-center">
<Link to={'/'} class="mr-6 flex items-center space-x-4">
<img src={logo192} alt="Naija Stars" class="h-8 w-8" />

<span class="hidden font-bold xl:inline-block">Naija Stars</span>

<Link
to={'/api'}
class="transition-colors text-foreground/50 hover:underline cursor-pointer"
let:active
>
<span class={active ? 'text-foreground/90' : ''}> API </span>
</Link>
</a>
</Link>
<Link
to={'/api'}
class="transition-colors text-foreground/50 hover:underline cursor-pointer"
let:active
>
<span class={active ? 'text-foreground/90' : ''}> API </span>
</Link>
<!-- <nav class="flex items-center gap-3 text-sm">
</nav> -->
Expand Down

0 comments on commit 8bb8da1

Please sign in to comment.