-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use the new long-term storage
store
method
For #383.
- Loading branch information
Showing
5 changed files
with
85 additions
and
134 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2023, University of Colorado Boulder | ||
|
||
/** | ||
* For a given prepared translation, store each repo's contents in long-term storage. | ||
* | ||
* @author Liam Mulhall <liammulh@gmail.com> | ||
*/ | ||
|
||
import logger from './logger.js'; | ||
import { longTermStorage } from './translationApi.js'; | ||
|
||
const storeEachRepoContents = async ( preparedTranslation, repos ) => { | ||
logger.info( `attempting to store repo contents for ${preparedTranslation.locale}/${preparedTranslation.simName} long-term` ); | ||
let allRepoContentsStored = true; | ||
for ( const repo of repos ) { | ||
const repoContents = preparedTranslation.translationFileContents[ repo ]; | ||
const wasStored = await longTermStorage.store( repo, preparedTranslation.locale, repoContents ); | ||
if ( !wasStored ) { | ||
allRepoContentsStored = false; | ||
} | ||
} | ||
logger.info( `all repo contents were stored: ${allRepoContentsStored}` ); | ||
logger.info( `done attempting to store repo contents for ${preparedTranslation.locale}/${preparedTranslation.simName} long-term` ); | ||
return allRepoContentsStored; | ||
}; | ||
|
||
export default storeEachRepoContents; |
This file was deleted.
Oops, something went wrong.