1
1
use std:: collections:: HashSet ;
2
2
use std:: fs;
3
+ use std:: ops:: Deref ;
3
4
use std:: path:: Path ;
4
5
use std:: sync:: LazyLock ;
5
6
use std:: time:: Duration ;
@@ -17,6 +18,13 @@ use crate::github_repo_info::{GithubModName, GithubRepoInfo};
17
18
use crate :: mod_directory:: ModDirectory ;
18
19
use crate :: server:: check_secret;
19
20
21
+ const TRIGGER_UPDATE_IGNORED_REPOSITORIES : & [ & str ] = & [
22
+ // TODO:
23
+ // Large repository, causes OOM for some reason
24
+ // https://github.com/dima74/factorio-mods-localization/issues/25
25
+ "robot256/cargo_ships" ,
26
+ ] ;
27
+
20
28
#[ get( "/triggerUpdate?<repo>&<subpath>&<secret>" ) ]
21
29
pub async fn trigger_update (
22
30
repo : Option < String > ,
@@ -106,10 +114,18 @@ fn filter_repositories_for_update_all(
106
114
) -> Vec < ( GithubRepoInfo , InstallationId ) > {
107
115
repositories
108
116
. retain ( |( repo_info, _) | {
117
+ if TRIGGER_UPDATE_IGNORED_REPOSITORIES . contains ( & repo_info. full_name . deref ( ) ) {
118
+ info ! (
119
+ "[update-github-from-crowdin] [{}] skipping update (ignored)" ,
120
+ repo_info. full_name
121
+ ) ;
122
+ return false ;
123
+ } ;
124
+
109
125
let weekly_update_from_crowdin = repo_info. weekly_update_from_crowdin ;
110
126
if !weekly_update_from_crowdin {
111
127
info ! (
112
- "[update-github-from-crowdin] [{}] skipping update because weekly_update_from_crowdin=false" ,
128
+ "[update-github-from-crowdin] [{}] skipping update because weekly_update_from_crowdin=false" ,
113
129
repo_info. full_name
114
130
) ;
115
131
}
@@ -178,7 +194,7 @@ async fn move_translated_files_to_mod_directory(mod_directory: &ModDirectory, tr
178
194
delete_unmatched_localization_files ( mod_directory) ;
179
195
for ( language_path, language) in util:: read_dir ( translation_directory) {
180
196
if !language_is_enabled_for_mod_on_crowdin ( & mod_directory. github_name , & language) { continue ; }
181
-
197
+
182
198
let language_path_crowdin = language_path. join ( get_crowdin_directory_name ( & mod_directory. github_name ) ) ;
183
199
assert ! ( language_path_crowdin. exists( ) ) ;
184
200
let files = util:: read_dir ( & language_path_crowdin) . collect :: < Vec < _ > > ( ) ;
@@ -226,6 +242,6 @@ fn language_is_enabled_for_mod_on_crowdin(github_name: &GithubModName, language:
226
242
if github_name. owner == "PennyJim" && github_name. repo == "pirate-locale" {
227
243
return language == "fr" ;
228
244
}
229
-
245
+
230
246
true
231
247
}
0 commit comments