mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 10:57:04 +00:00
Randomize subscription minute
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {Capacitor} from "@capacitor/core"
|
import {Capacitor} from "@capacitor/core"
|
||||||
import {preventDefault} from "@lib/html"
|
import {preventDefault} from "@lib/html"
|
||||||
|
import {randomInt} from "@welshman/lib"
|
||||||
import {displayRelayUrl, THREAD, MESSAGE, EVENT_TIME, COMMENT} from "@welshman/util"
|
import {displayRelayUrl, THREAD, MESSAGE, EVENT_TIME, COMMENT} from "@welshman/util"
|
||||||
import type {Filter} from "@welshman/util"
|
import type {Filter} from "@welshman/util"
|
||||||
import {pubkey} from "@welshman/app"
|
import {pubkey} from "@welshman/app"
|
||||||
@@ -24,9 +25,10 @@
|
|||||||
.match(/GMT[^\s]+/)![0]
|
.match(/GMT[^\s]+/)![0]
|
||||||
.slice(3)
|
.slice(3)
|
||||||
const timezoneOffset = parseInt(timezone) / 100
|
const timezoneOffset = parseInt(timezone) / 100
|
||||||
|
const minute = randomInt(0, 59)
|
||||||
const hour = (17 - timezoneOffset) % 24
|
const hour = (17 - timezoneOffset) % 24
|
||||||
const WEEKLY = `0 03 ${hour} * * 1`
|
const WEEKLY = `0 ${minute} ${hour} * * 1`
|
||||||
const DAILY = `0 03 ${hour} * * *`
|
const DAILY = `0 ${minute} ${hour} * * *`
|
||||||
|
|
||||||
let loading = false
|
let loading = false
|
||||||
let cron = WEEKLY
|
let cron = WEEKLY
|
||||||
|
|||||||
Reference in New Issue
Block a user