add mastodon cron
This commit is contained in:
parent
6249124c17
commit
ded5314125
2 changed files with 13 additions and 7 deletions
|
|
@ -11,7 +11,7 @@ instance.
|
||||||
|
|
||||||
- [x] BlueSky
|
- [x] BlueSky
|
||||||
- [ ] Pixelfed
|
- [ ] Pixelfed
|
||||||
- [ ] Mastodon
|
- [x] Mastodon
|
||||||
- [ ] Nostr
|
- [ ] Nostr
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@ $ java -jar ./target/micro-blog-standalone.jar
|
||||||
Build new docker image and push it to ECR
|
Build new docker image and push it to ECR
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ docker buildx build --platform linux/amd64,linux/arm64 -t 853019563312.dkr.ecr.eu-central-1.amazonaws.com/micro-blog-fetchers:2.0.1 --push .
|
$ docker buildx build --platform linux/amd64,linux/arm64 -t 853019563312.dkr.ecr.eu-central-1.amazonaws.com/micro-blog-fetchers-homelabstack:latest --push .
|
||||||
```
|
```
|
||||||
|
|
||||||
## Project history
|
## Project history
|
||||||
|
|
@ -44,3 +44,4 @@ $ docker buildx build --platform linux/amd64,linux/arm64 -t 853019563312.dkr.ec
|
||||||
cluster running I'm switching most of my personal apps to on-prem. Pocketbase instance is already running on-prem.
|
cluster running I'm switching most of my personal apps to on-prem. Pocketbase instance is already running on-prem.
|
||||||
For this app I swap Serverless for docker container. App now deployed on-prem and the docker containers run once per hour
|
For this app I swap Serverless for docker container. App now deployed on-prem and the docker containers run once per hour
|
||||||
thanks to Nomad's job scheduling.
|
thanks to Nomad's job scheduling.
|
||||||
|
- July 2025: Start rewrite in Clojure with a long running docker container deployment instead of scheduled runs.
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,17 @@
|
||||||
(:import [java.time Instant Duration])
|
(:import [java.time Instant Duration])
|
||||||
(:require [chime.core :as chime]
|
(:require [chime.core :as chime]
|
||||||
[taoensso.telemere :as tel]
|
[taoensso.telemere :as tel]
|
||||||
[micro-blog.blue-sky :as blue-sky]))
|
[micro-blog.blue-sky :as blue-sky]
|
||||||
|
[micro-blog.mastodon :as masto]))
|
||||||
|
|
||||||
|
(def crons [blue-sky/run
|
||||||
|
masto/run])
|
||||||
|
|
||||||
(defn -main []
|
(defn -main []
|
||||||
(tel/log! :info "Setting up crons")
|
(tel/log! :info "Setting up crons")
|
||||||
(chime/chime-at (chime/periodic-seq (Instant/now) (Duration/ofMinutes 30))
|
(doseq [[i cron] (map-indexed vector crons)]
|
||||||
(fn [_time]
|
(let [start (.plus (Instant/now) (Duration/ofMinutes (* i 5)))]
|
||||||
(blue-sky/run)))
|
(chime/chime-at (chime/periodic-seq start (Duration/ofMinutes 30))
|
||||||
|
(fn [_time]
|
||||||
|
(cron)))))
|
||||||
@(promise))
|
@(promise))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue