.envrc: delete git deploy cache after 24h
This commit is contained in:
		
							parent
							
								
									0f74cc8c7e
								
							
						
					
					
						commit
						04a271a1e5
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		
							
								
								
									
										12
									
								
								.envrc
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								.envrc
									
									
									
									
									
								
							| 
						 | 
					@ -13,9 +13,17 @@ PATH_add bin
 | 
				
			||||||
python3 -m pip --require-virtualenv --quiet install --upgrade pip wheel
 | 
					python3 -m pip --require-virtualenv --quiet install --upgrade pip wheel
 | 
				
			||||||
python3 -m pip --require-virtualenv --quiet install --upgrade -r requirements.txt
 | 
					python3 -m pip --require-virtualenv --quiet install --upgrade -r requirements.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rm -rf .cache/bw/git_deploy
 | 
					# git deploy cache
 | 
				
			||||||
export BW_GIT_DEPLOY_CACHE=.cache/bw/git_deploy
 | 
					export BW_GIT_DEPLOY_CACHE=".cache/bw/git_deploy"
 | 
				
			||||||
 | 
					CREATED_AT=$(stat -f "%Sa" "$BW_GIT_DEPLOY_CACHE" | xargs -I{} date -f '%b %d %H:%M:%S %Y' -j "{}" '+%s')
 | 
				
			||||||
 | 
					NOW_AT=$(date +%s)
 | 
				
			||||||
 | 
					SECONDS_SINCE=$(expr "$NOW_AT" - "$CREATED_AT")
 | 
				
			||||||
 | 
					if [[ "$SECONDS_SINCE" > 86400 ]]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					  rm -rf "$BW_GIT_DEPLOY_CACHE"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
mkdir -p "$BW_GIT_DEPLOY_CACHE"
 | 
					mkdir -p "$BW_GIT_DEPLOY_CACHE"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export EXPERIMENTAL_UPLOAD_VIA_CAT=1
 | 
					export EXPERIMENTAL_UPLOAD_VIA_CAT=1
 | 
				
			||||||
export BW_ITEM_WORKERS=32
 | 
					export BW_ITEM_WORKERS=32
 | 
				
			||||||
export BW_NODE_WORKERS=12
 | 
					export BW_NODE_WORKERS=12
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue