]> Untitled Git - lemmy.git/commitdiff
Reorganizing files before splitting out API
authorDessalines <tyhou13@gmx.com>
Fri, 3 May 2019 01:34:21 +0000 (18:34 -0700)
committerDessalines <tyhou13@gmx.com>
Fri, 3 May 2019 01:34:21 +0000 (18:34 -0700)
20 files changed:
Dockerfile
server/Cargo.lock
server/Cargo.toml
server/src/apub.rs
server/src/db/category.rs [moved from server/src/actions/category.rs with 100% similarity]
server/src/db/comment.rs [moved from server/src/actions/comment.rs with 98% similarity]
server/src/db/comment_view.rs [moved from server/src/actions/comment_view.rs with 97% similarity]
server/src/db/community.rs [moved from server/src/actions/community.rs with 99% similarity]
server/src/db/community_view.rs [moved from server/src/actions/community_view.rs with 91% similarity]
server/src/db/mod.rs [moved from server/src/actions/mod.rs with 100% similarity]
server/src/db/moderator.rs [moved from server/src/actions/moderator.rs with 99% similarity]
server/src/db/moderator_views.rs [moved from server/src/actions/moderator_views.rs with 95% similarity]
server/src/db/post.rs [moved from server/src/actions/post.rs with 99% similarity]
server/src/db/post_view.rs [moved from server/src/actions/post_view.rs with 98% similarity]
server/src/db/user.rs [moved from server/src/actions/user.rs with 100% similarity]
server/src/db/user_view.rs [moved from server/src/actions/user_view.rs with 89% similarity]
server/src/lib.rs
server/src/main.rs [moved from server/src/bin/main.rs with 96% similarity]
server/src/websocket/mod.rs [moved from server/src/websocket_server/mod.rs with 100% similarity]
server/src/websocket/server.rs [moved from server/src/websocket_server/server.rs with 99% similarity]

index 3f3aa4e767ed781f62f1cabfaf508805055e5be2..e794b249b38672b62fb8c79c85c919649135b4f8 100644 (file)
@@ -21,7 +21,7 @@ COPY server/Cargo.toml server/Cargo.lock ./
 RUN  mkdir -p ./src/bin \
   && echo 'fn main() { println!("Dummy") }' > ./src/bin/main.rs 
 RUN cargo build --release --bin lemmy
-RUN rm -r ./target/release/.fingerprint/server-*
+RUN rm -r ./target/release/.fingerprint/lemmy_server-*
 
 # copy your source tree
 # RUN rm -rf ./src/
index 36d2a9014839e5de08a1b75d0b5da1da90e6efe3..659bd235c87936df926550b704745bec52c248ab 100644 (file)
@@ -752,6 +752,30 @@ name = "lazycell"
 version = "1.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "lemmy_server"
+version = "0.0.1"
+dependencies = [
+ "activitypub 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "actix 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "actix-web 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bcrypt 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "diesel 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "diesel_migrations 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "dotenv 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "jsonwebtoken 5.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
+ "strum 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "strum_macros 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "libc"
 version = "0.2.49"
@@ -1344,30 +1368,6 @@ dependencies = [
  "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "server"
-version = "0.0.1"
-dependencies = [
- "activitypub 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "actix 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "actix-web 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "bcrypt 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "diesel 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "diesel_migrations 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "dotenv 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "jsonwebtoken 5.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
- "strum 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "strum_macros 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "sha1"
 version = "0.6.0"
index 1daaca663660e9311c7ac49b6fca9a62353df001..5ee8b8a636a7f428d9351788c871ab15ef211b63 100644 (file)
@@ -1,12 +1,7 @@
 [package]
-name = "server"
+name = "lemmy_server"
 version = "0.0.1"
 authors = ["Dessalines <happydooby@gmail.com>"]
-autobins = false
-
-[[bin]]
-name = "lemmy"
-path = "src/bin/main.rs"
 
 [dependencies]
 diesel = { version = "1.4.2", features = ["postgres","chrono"] }
index 4fc0ba3343f944f44a8a075a0b682014584cf2aa..3d9595c810bbfc5f5409182f8c8c114da1d902da 100644 (file)
@@ -1,6 +1,6 @@
 extern crate activitypub;
 use self::activitypub::{context, actor::Person};
-use actions::user::User_;
+use db::user::User_;
 
 impl User_ {
   pub fn person(&self) -> Person {
similarity index 98%
rename from server/src/actions/comment.rs
rename to server/src/db/comment.rs
index 4bbc7c04d8d68a781733cd81e66128435e78c348..d63837a097d949d1933bc4109eca103af40e5611 100644 (file)
@@ -4,7 +4,7 @@ use diesel::*;
 use diesel::result::Error;
 use serde::{Deserialize, Serialize};
 use {Crud, Likeable, Saveable};
-use actions::post::Post;
+use super::post::Post;
 
 // WITH RECURSIVE MyTree AS (
 //     SELECT * FROM comment WHERE parent_id IS NULL
@@ -160,9 +160,9 @@ impl Saveable <CommentSavedForm> for CommentSaved {
 mod tests {
   use establish_connection;
   use super::*;
-  use actions::post::*;
-  use actions::community::*;
-  use actions::user::*;
+  use super::super::post::*;
+  use super::super::community::*;
+  use super::super::user::*;
   use Crud;
  #[test]
   fn test_crud() {
similarity index 97%
rename from server/src/actions/comment_view.rs
rename to server/src/db/comment_view.rs
index eb6276cc209dbee82d40b6b724258f4d266c8142..903c4839d09af9916f130156098d5d5b5581a66d 100644 (file)
@@ -68,7 +68,7 @@ impl CommentView {
               page: Option<i64>,
               limit: Option<i64>,
               ) -> Result<Vec<Self>, Error> {
-    use actions::comment_view::comment_view::dsl::*;
+    use super::comment_view::comment_view::dsl::*;
 
     let (limit, offset) = limit_and_offset(page, limit);
 
@@ -125,7 +125,7 @@ impl CommentView {
   }
 
   pub fn read(conn: &PgConnection, from_comment_id: i32, my_user_id: Option<i32>) -> Result<Self, Error> {
-    use actions::comment_view::comment_view::dsl::*;
+    use super::comment_view::comment_view::dsl::*;
 
     let mut query = comment_view.into_boxed();
 
@@ -206,7 +206,7 @@ impl ReplyView {
               page: Option<i64>,
               limit: Option<i64>,
               ) -> Result<Vec<Self>, Error> {
-    use actions::comment_view::reply_view::dsl::*;
+    use super::comment_view::reply_view::dsl::*;
 
     let (limit, offset) = limit_and_offset(page, limit);
 
@@ -251,10 +251,10 @@ impl ReplyView {
 mod tests {
   use establish_connection;
   use super::*;
-  use actions::post::*;
-  use actions::community::*;
-  use actions::user::*;
-  use actions::comment::*;
+  use super::super::post::*;
+  use super::super::community::*;
+  use super::super::user::*;
+  use super::super::comment::*;
   use {Crud,Likeable};
  #[test]
   fn test_crud() {
similarity index 99%
rename from server/src/actions/community.rs
rename to server/src/db/community.rs
index db53ceb977b2ba9b19bbc030cec24aec3994e732..2e75828fce3d40f6e2bfa6b83d2f317a5e9e56e6 100644 (file)
@@ -221,7 +221,7 @@ impl Crud<SiteForm> for Site {
 mod tests {
   use establish_connection;
   use super::*;
-  use actions::user::*;
+  use super::super::user::*;
   use Crud;
  #[test]
   fn test_crud() {
similarity index 91%
rename from server/src/actions/community_view.rs
rename to server/src/db/community_view.rs
index 9a162746a03ae927336008ebfff60baf01bf6ef9..5ec22f4e3a6621da7e9cb5d6bbf59e9ac12c45cc 100644 (file)
@@ -100,7 +100,7 @@ pub struct CommunityView {
 
 impl CommunityView {
   pub fn read(conn: &PgConnection, from_community_id: i32, from_user_id: Option<i32>) -> Result<Self, Error> {
-    use actions::community_view::community_view::dsl::*;
+    use super::community_view::community_view::dsl::*;
 
     let mut query = community_view.into_boxed();
 
@@ -122,7 +122,7 @@ impl CommunityView {
               page: Option<i64>,
               limit: Option<i64>,
               ) -> Result<Vec<Self>, Error> {
-    use actions::community_view::community_view::dsl::*;
+    use super::community_view::community_view::dsl::*;
     let mut query = community_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
@@ -163,12 +163,12 @@ pub struct CommunityModeratorView {
 
 impl CommunityModeratorView {
   pub fn for_community(conn: &PgConnection, from_community_id: i32) -> Result<Vec<Self>, Error> {
-    use actions::community_view::community_moderator_view::dsl::*;
+    use super::community_view::community_moderator_view::dsl::*;
     community_moderator_view.filter(community_id.eq(from_community_id)).load::<Self>(conn)
   }
 
   pub fn for_user(conn: &PgConnection, from_user_id: i32) -> Result<Vec<Self>, Error> {
-    use actions::community_view::community_moderator_view::dsl::*;
+    use super::community_view::community_moderator_view::dsl::*;
     community_moderator_view.filter(user_id.eq(from_user_id)).load::<Self>(conn)
   }
 }
@@ -186,12 +186,12 @@ pub struct CommunityFollowerView {
 
 impl CommunityFollowerView {
   pub fn for_community(conn: &PgConnection, from_community_id: i32) -> Result<Vec<Self>, Error> {
-    use actions::community_view::community_follower_view::dsl::*;
+    use super::community_view::community_follower_view::dsl::*;
     community_follower_view.filter(community_id.eq(from_community_id)).load::<Self>(conn)
   }
 
   pub fn for_user(conn: &PgConnection, from_user_id: i32) -> Result<Vec<Self>, Error> {
-    use actions::community_view::community_follower_view::dsl::*;
+    use super::community_view::community_follower_view::dsl::*;
     community_follower_view.filter(user_id.eq(from_user_id)).load::<Self>(conn)
   }
 }
@@ -210,17 +210,17 @@ pub struct CommunityUserBanView {
 
 impl CommunityUserBanView {
   pub fn for_community(conn: &PgConnection, from_community_id: i32) -> Result<Vec<Self>, Error> {
-    use actions::community_view::community_user_ban_view::dsl::*;
+    use super::community_view::community_user_ban_view::dsl::*;
     community_user_ban_view.filter(community_id.eq(from_community_id)).load::<Self>(conn)
   }
 
   pub fn for_user(conn: &PgConnection, from_user_id: i32) -> Result<Vec<Self>, Error> {
-    use actions::community_view::community_user_ban_view::dsl::*;
+    use super::community_view::community_user_ban_view::dsl::*;
     community_user_ban_view.filter(user_id.eq(from_user_id)).load::<Self>(conn)
   }
 
   pub fn get(conn: &PgConnection, from_user_id: i32, from_community_id: i32) -> Result<Self, Error> {
-    use actions::community_view::community_user_ban_view::dsl::*;
+    use super::community_view::community_user_ban_view::dsl::*;
     community_user_ban_view
       .filter(user_id.eq(from_user_id))
       .filter(community_id.eq(from_community_id))
@@ -246,7 +246,7 @@ pub struct SiteView {
 
 impl SiteView {
   pub fn read(conn: &PgConnection) -> Result<Self, Error> {
-    use actions::community_view::site_view::dsl::*;
+    use super::community_view::site_view::dsl::*;
     site_view.first::<Self>(conn)
   }
 }
similarity index 99%
rename from server/src/actions/moderator.rs
rename to server/src/db/moderator.rs
index 794d91e744f260bbfea1597083455a277dd1478a..74068e0a689a5b4fb120b2704046bd7cfd37585e 100644 (file)
@@ -400,10 +400,10 @@ impl Crud<ModAddForm> for ModAdd {
 mod tests {
   use establish_connection;
   use super::*;
-  use actions::user::*;
-  use actions::post::*;
-  use actions::community::*;
-  use actions::comment::*;
+  use super::super::user::*;
+  use super::super::post::*;
+  use super::super::community::*;
+  use super::super::comment::*;
   // use Crud;
  #[test]
   fn test_crud() {
similarity index 95%
rename from server/src/actions/moderator_views.rs
rename to server/src/db/moderator_views.rs
index 89418277102ae2662ddcf1f2b9b2b88e5169bb60..56881ef547263a944ccd4fab74a108c648090432 100644 (file)
@@ -41,7 +41,7 @@ impl ModRemovePostView {
               page: Option<i64>,
               limit: Option<i64>, 
               ) -> Result<Vec<Self>, Error> {
-    use actions::moderator_views::mod_remove_post_view::dsl::*;
+    use super::moderator_views::mod_remove_post_view::dsl::*;
     let mut query = mod_remove_post_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
@@ -94,7 +94,7 @@ impl ModLockPostView {
               page: Option<i64>,
               limit: Option<i64>, 
               ) -> Result<Vec<Self>, Error> {
-    use actions::moderator_views::mod_lock_post_view::dsl::*;
+    use super::moderator_views::mod_lock_post_view::dsl::*;
     let mut query = mod_lock_post_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
@@ -156,7 +156,7 @@ impl ModRemoveCommentView {
               page: Option<i64>,
               limit: Option<i64>, 
              ) -> Result<Vec<Self>, Error> {
-    use actions::moderator_views::mod_remove_comment_view::dsl::*;
+    use super::moderator_views::mod_remove_comment_view::dsl::*;
     let mut query = mod_remove_comment_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
@@ -207,7 +207,7 @@ impl ModRemoveCommunityView {
               page: Option<i64>,
               limit: Option<i64>, 
               ) -> Result<Vec<Self>, Error> {
-    use actions::moderator_views::mod_remove_community_view::dsl::*;
+    use super::moderator_views::mod_remove_community_view::dsl::*;
     let mut query = mod_remove_community_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
@@ -260,7 +260,7 @@ impl ModBanFromCommunityView {
               page: Option<i64>,
               limit: Option<i64>, 
               ) -> Result<Vec<Self>, Error> {
-    use actions::moderator_views::mod_ban_from_community_view::dsl::*;
+    use super::moderator_views::mod_ban_from_community_view::dsl::*;
     let mut query = mod_ban_from_community_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
@@ -311,7 +311,7 @@ impl ModBanView {
               page: Option<i64>,
               limit: Option<i64>, 
               ) -> Result<Vec<Self>, Error> {
-    use actions::moderator_views::mod_ban_view::dsl::*;
+    use super::moderator_views::mod_ban_view::dsl::*;
     let mut query = mod_ban_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
@@ -359,7 +359,7 @@ impl ModAddCommunityView {
               page: Option<i64>,
               limit: Option<i64>, 
               ) -> Result<Vec<Self>, Error> {
-    use actions::moderator_views::mod_add_community_view::dsl::*;
+    use super::moderator_views::mod_add_community_view::dsl::*;
     let mut query = mod_add_community_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
@@ -406,7 +406,7 @@ impl ModAddView {
               page: Option<i64>,
               limit: Option<i64>, 
               ) -> Result<Vec<Self>, Error> {
-    use actions::moderator_views::mod_add_view::dsl::*;
+    use super::moderator_views::mod_add_view::dsl::*;
     let mut query = mod_add_view.into_boxed();
 
     let (limit, offset) = limit_and_offset(page, limit);
similarity index 99%
rename from server/src/actions/post.rs
rename to server/src/db/post.rs
index 495a8b09e59253c0cd95998d6c99c9c8e17354e8..59a7a1d44c5cb2bb519bac433c55779a2d9810fa 100644 (file)
@@ -173,10 +173,10 @@ impl Readable <PostReadForm> for PostRead {
 #[cfg(test)]
 mod tests {
   use establish_connection;
-  use super::*;
   use Crud;
-  use actions::community::*;
-  use actions::user::*;
+  use super::*;
+  use super::super::community::*;
+  use super::super::user::*;
  #[test]
   fn test_crud() {
     let conn = establish_connection();
similarity index 98%
rename from server/src/actions/post_view.rs
rename to server/src/db/post_view.rs
index 18287651dc7b9fa6369651ee42ef7f4bd3042c0f..6dc6b6ef8322a3b0969c1fb3f442ea1ce63ce12f 100644 (file)
@@ -85,7 +85,7 @@ impl PostView {
               page: Option<i64>,
               limit: Option<i64>,
               ) -> Result<Vec<Self>, Error> {
-    use actions::post_view::post_view::dsl::*;
+    use super::post_view::post_view::dsl::*;
 
     let (limit, offset) = limit_and_offset(page, limit);
 
@@ -158,7 +158,7 @@ impl PostView {
 
   pub fn read(conn: &PgConnection, from_post_id: i32, my_user_id: Option<i32>) -> Result<Self, Error> {
 
-    use actions::post_view::post_view::dsl::*;
+    use super::post_view::post_view::dsl::*;
     use diesel::prelude::*;
 
     let mut query = post_view.into_boxed();
@@ -181,9 +181,9 @@ impl PostView {
 mod tests {
   use {establish_connection, Crud, Likeable};
   use super::*;
-  use actions::community::*;
-  use actions::user::*;
-  use actions::post::*;
+  use super::super::community::*;
+  use super::super::user::*;
+  use super::super::post::*;
   #[test]
   fn test_crud() {
     let conn = establish_connection();
similarity index 89%
rename from server/src/actions/user_view.rs
rename to server/src/db/user_view.rs
index a5187aee5a10e7fae128e8f5d51d69aa885e3375..f17fd8c95b2330efa746f6dceae908839f2f950a 100644 (file)
@@ -35,20 +35,20 @@ pub struct UserView {
 
 impl UserView {
   pub fn read(conn: &PgConnection, from_user_id: i32) -> Result<Self, Error> {
-    use actions::user_view::user_view::dsl::*;
+    use super::user_view::user_view::dsl::*;
 
     user_view.find(from_user_id)
     .first::<Self>(conn)
   }
 
   pub fn admins(conn: &PgConnection) -> Result<Vec<Self>, Error> {
-    use actions::user_view::user_view::dsl::*;
+    use super::user_view::user_view::dsl::*;
     user_view.filter(admin.eq(true))
     .load::<Self>(conn)
   }
 
   pub fn banned(conn: &PgConnection) -> Result<Vec<Self>, Error> {
-    use actions::user_view::user_view::dsl::*;
+    use super::user_view::user_view::dsl::*;
     user_view.filter(banned.eq(true))
     .load::<Self>(conn)
   }
index 71b72ac3241a454d5f64d4322140f0f7fa0fa702..a453633e296c120ffbfd7826d8b3b850bb8e86e6 100644 (file)
@@ -17,8 +17,8 @@ pub extern crate regex;
 
 pub mod schema;
 pub mod apub;
-pub mod actions;
-pub mod websocket_server;
+pub mod db;
+pub mod websocket;
 
 use diesel::*;
 use diesel::pg::PgConnection;
similarity index 96%
rename from server/src/bin/main.rs
rename to server/src/main.rs
index c2fde341d5490053348c6478f2f7136b3c1b2e81..3e51785b30bdc1fa47efc6f7ccc290baea5137bc 100644 (file)
@@ -1,14 +1,13 @@
-extern crate server;
+extern crate lemmy_server;
 #[macro_use] extern crate diesel_migrations;
 
 use std::time::{Instant, Duration};
 use std::env;
-use server::actix::*;
-use server::actix_web::server::HttpServer;
-use server::actix_web::{ws, App, Error, HttpRequest, HttpResponse, fs::NamedFile, fs};
-
-use server::websocket_server::server::*;
-use server::establish_connection;
+use lemmy_server::actix::*;
+use lemmy_server::actix_web::server::HttpServer;
+use lemmy_server::actix_web::{ws, App, Error, HttpRequest, HttpResponse, fs::NamedFile, fs};
+use lemmy_server::websocket::server::*;
+use lemmy_server::establish_connection;
 
 embed_migrations!();
 
similarity index 99%
rename from server/src/websocket_server/server.rs
rename to server/src/websocket/server.rs
index 82c4007d7aca7eba107c884aaaecfdb2bd6df4ba..a530b9a6594d3b3f1d79c212818f7485700d5dd3 100644 (file)
@@ -14,17 +14,17 @@ use failure::Error;
 use std::time::{SystemTime};
 
 use {Crud, Joinable, Likeable, Followable, Bannable, Saveable, establish_connection, naive_now, naive_from_unix, SortType, SearchType, has_slurs, remove_slurs, Settings};
-use actions::community::*;
-use actions::user::*;
-use actions::post::*;
-use actions::comment::*;
-use actions::post_view::*;
-use actions::comment_view::*;
-use actions::category::*;
-use actions::community_view::*;
-use actions::user_view::*;
-use actions::moderator_views::*;
-use actions::moderator::*;
+use db::community::*;
+use db::user::*;
+use db::post::*;
+use db::comment::*;
+use db::post_view::*;
+use db::comment_view::*;
+use db::category::*;
+use db::community_view::*;
+use db::user_view::*;
+use db::moderator_views::*;
+use db::moderator::*;
 
 const RATE_LIMIT_MESSAGES: i32 = 30;
 const RATE_LIMIT_PER_SECOND: i32 = 60;