mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Move check_for_restart
from zcl_abapgit_repo
(#6470)
Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
e92a41c132
commit
d5b11d15ab
|
@ -140,7 +140,6 @@ CLASS zcl_abapgit_repo DEFINITION
|
|||
zcx_abapgit_exception .
|
||||
PRIVATE SECTION.
|
||||
|
||||
METHODS check_for_restart .
|
||||
METHODS check_language
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
|
@ -208,29 +207,6 @@ CLASS zcl_abapgit_repo IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD check_for_restart.
|
||||
|
||||
CONSTANTS:
|
||||
lc_abapgit_prog TYPE progname VALUE `ZABAPGIT`.
|
||||
|
||||
" If abapGit was used to update itself, then restart to avoid LOAD_PROGRAM_&_MISMATCH dumps
|
||||
" because abapGit code was changed at runtime
|
||||
IF zcl_abapgit_ui_factory=>get_frontend_services( )->gui_is_available( ) = abap_true AND
|
||||
zcl_abapgit_url=>is_abapgit_repo( ms_data-url ) = abap_true AND
|
||||
sy-batch = abap_false AND
|
||||
sy-cprog = lc_abapgit_prog.
|
||||
|
||||
IF zcl_abapgit_persist_factory=>get_settings( )->read( )->get_show_default_repo( ) = abap_false.
|
||||
MESSAGE 'abapGit was updated and will restart itself' TYPE 'I'.
|
||||
ENDIF.
|
||||
|
||||
SUBMIT (sy-cprog).
|
||||
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD check_language.
|
||||
|
||||
DATA:
|
||||
|
@ -734,8 +710,6 @@ CLASS zcl_abapgit_repo IMPLEMENTATION.
|
|||
|
||||
COMMIT WORK AND WAIT.
|
||||
|
||||
check_for_restart( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
|
|
|
@ -114,6 +114,9 @@ CLASS zcl_abapgit_services_repo DEFINITION
|
|||
iv_devclass TYPE scompkdtln-devclass
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
CLASS-METHODS check_for_restart
|
||||
IMPORTING
|
||||
!io_repo TYPE REF TO zif_abapgit_repo.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
@ -192,6 +195,37 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD check_for_restart.
|
||||
|
||||
CONSTANTS:
|
||||
lc_abapgit_prog TYPE progname VALUE `ZABAPGIT`.
|
||||
|
||||
DATA lo_repo_online TYPE REF TO zcl_abapgit_repo_online.
|
||||
|
||||
IF io_repo->is_offline( ) = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
lo_repo_online ?= io_repo.
|
||||
|
||||
" If abapGit was used to update itself, then restart to avoid LOAD_PROGRAM_&_MISMATCH dumps
|
||||
" because abapGit code was changed at runtime
|
||||
IF zcl_abapgit_ui_factory=>get_frontend_services( )->gui_is_available( ) = abap_true AND
|
||||
zcl_abapgit_url=>is_abapgit_repo( lo_repo_online->get_url( ) ) = abap_true AND
|
||||
sy-batch = abap_false AND
|
||||
sy-cprog = lc_abapgit_prog.
|
||||
|
||||
IF zcl_abapgit_persist_factory=>get_settings( )->read( )->get_show_default_repo( ) = abap_false.
|
||||
MESSAGE 'abapGit was updated and will restart itself' TYPE 'I'.
|
||||
ENDIF.
|
||||
|
||||
SUBMIT (sy-cprog).
|
||||
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD check_package.
|
||||
|
||||
DATA:
|
||||
|
@ -327,6 +361,8 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION.
|
|||
MESSAGE lv_msg TYPE 'S'.
|
||||
ENDIF.
|
||||
|
||||
check_for_restart( io_repo ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user