Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
}