-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Queue video processing job on upload (#15)
* Change queue to a lib * Add forge=debug to default tracer * Change video ids to use nanoid * Add configurable ffmpeg location and uploads dir * Add posting a queue job after video upload * Add videos directory to gitignore * Fix start-queue to use forge package
- Loading branch information
1 parent
826fc9b
commit 033a3fb
Showing
20 changed files
with
109 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ target/ | |
.env* | ||
!.env.example | ||
uploads/ | ||
videos/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
members = [ | ||
"packages/db", | ||
"packages/vod", | ||
"packages/queue", | ||
"services/forge-queue", | ||
"services/silo-api", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
CREATE TYPE processing_status AS ENUM ('pending', 'processing', 'completed', 'failed'); | ||
|
||
CREATE TABLE videos ( | ||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | ||
id TEXT PRIMARY KEY, | ||
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, | ||
title VARCHAR(100) NOT NULL, | ||
raw_video_path VARCHAR(255) NOT NULL, | ||
processed_video_path VARCHAR(255), | ||
processing_status processing_status NOT NULL DEFAULT 'pending', | ||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP | ||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
CREATE INDEX videos_user_id_idx ON videos(user_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "queue" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
async-trait = "0.1" | ||
chrono = "0.4" | ||
db = { path = "../../packages/db" } | ||
futures = "0.3" | ||
serde = { version = "1", features = ["derive"] } | ||
thiserror = "1" | ||
sqlx = { version = "0.7", features = [ | ||
"runtime-tokio-rustls", | ||
"postgres", | ||
"chrono", | ||
"uuid", | ||
"json", | ||
] } | ||
tokio = { version = "1", features = ["full"] } | ||
tracing = "0.1" | ||
ulid = { version = "1", features = ["uuid"] } | ||
uuid = { version = "1", features = ["serde", "v4"] } | ||
vod = { path = "../../packages/vod" } |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pub mod error; | ||
pub mod job; | ||
pub mod queue; | ||
pub mod runner; | ||
|
||
pub use queue::{Job, PostgresQueue, Queue}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
[package] | ||
name = "queue" | ||
name = "forge" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
anyhow = "1" | ||
async-trait = "0.1" | ||
chrono = "0.4" | ||
db = { path = "../../packages/db" } | ||
futures = "0.3" | ||
serde = { version = "1", features = ["derive"] } | ||
thiserror = "1" | ||
sqlx = { version = "0.7", features = [ | ||
"runtime-tokio-rustls", | ||
"postgres", | ||
"chrono", | ||
"uuid", | ||
"json", | ||
] } | ||
queue = { path = "../../packages/queue" } | ||
tokio = { version = "1", features = ["full"] } | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3", features = ["env-filter"] } | ||
ulid = { version = "1", features = ["uuid"] } | ||
uuid = { version = "1", features = ["serde", "v4"] } | ||
vod = { path = "../../packages/vod" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters