Skip to content

Commit

Permalink
Merge pull request #437 from Hou-Xiaoxuan/doc_split_lfs
Browse files Browse the repository at this point in the history
add doc
  • Loading branch information
genedna authored Jul 5, 2024
2 parents eea221e + 3bf91e9 commit d988859
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 76 deletions.
23 changes: 19 additions & 4 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@

```bash
$ cd mega
$ cargo run init -d postgres
$ cargo run init
```

7. Start the Mega server for testing.
Expand Down Expand Up @@ -260,7 +260,7 @@
[database]
# database connection url
db_url = "postgres://postgres:postgres@localhost:5432/mega"
db_url = "postgres://mega:mega@localhost:5432/mega"
# db max connection, setting it to twice the number of CPU cores would be appropriate.
max_connection = 32
Expand Down Expand Up @@ -310,15 +310,22 @@
pack_decode_cache_path = "/tmp/.mega/cache"
clean_cache_after_decode = true
[lfs]
## IMPORTANT: The 'enable_split' feature can only be enabled for new databases. Existing databases do not support this feature.
# Enable or disable splitting large files into smaller chunks
enable_split = false # Default is disabled. Set to true to enable file splitting.
# Size of each file chunk when splitting is enabled, in bytes. Ignored if splitting is disabled.
split_size = 20971520 # Default size is 20MB (20971520 bytes)
```

6. Init Mega.

```bash
$ cd mega
$ cargo run init -d postgres
$ cargo run init
```

7. Start Mega server.
Expand Down Expand Up @@ -382,7 +389,7 @@ Config `confg.toml` file for the Mega project.
[database]
# database connection url
db_url = "postgres://postgres:postgres@localhost:5432/mega"
db_url = "postgres://mega:mega@localhost:5432/mega"
# db max connection, setting it to twice the number of CPU cores would be appropriate.
max_connection = 2
Expand Down Expand Up @@ -430,6 +437,14 @@ Config `confg.toml` file for the Mega project.
pack_decode_cache_path = "/tmp/.mega/cache"
clean_cache_after_decode = true
[lfs]
## IMPORTANT: The 'enable_split' feature can only be enabled for new databases. Existing databases do not support this feature.
# Enable or disable splitting large files into smaller chunks
enable_split = false # Default is disabled. Set to true to enable file splitting.
# Size of each file chunk when splitting is enabled, in bytes. Ignored if splitting is disabled.
split_size = 20971520 # Default size is 20MB (20971520 bytes)
```

## Comment Guideline
Expand Down
10 changes: 7 additions & 3 deletions mega/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ print_std = true

[database]
# database connection url
db_url = "postgres://postgres:postgres@localhost:5432/mega"
db_url = "postgres://mega:mega@localhost:5432/mega"

# db max connection, setting it to twice the number of CPU cores would be appropriate.
max_connection = 32
Expand Down Expand Up @@ -75,5 +75,9 @@ hub = "http://127.0.0.1:8888"
agent = "http://127.0.0.1:7777"

[lfs]
enable_split = true
split_size = 20971520 # 20MB
## IMPORTANT: The 'enable_split' feature can only be enabled for new databases. Existing databases do not support this feature.
# Enable or disable splitting large files into smaller chunks
enable_split = true # Default is disabled. Set to true to enable file splitting.

# Size of each file chunk when splitting is enabled, in bytes. Ignored if splitting is disabled.
split_size = 20971520 # Default size is 20MB (20971520 bytes)
69 changes: 0 additions & 69 deletions mega/config.toml.example

This file was deleted.

4 changes: 4 additions & 0 deletions mega/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
//!

fn main() -> shadow_rs::SdResult<()> {
#[cfg(target_os = "linux")]
println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN");
#[cfg(target_os = "macos")]
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");
shadow_rs::new()
}

1 comment on commit d988859

@vercel
Copy link

@vercel vercel bot commented on d988859 Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mega – ./

mega-git-main-gitmono.vercel.app
gitmega.dev
mega-gitmono.vercel.app
www.gitmega.dev

Please sign in to comment.